Improved measurements and tables pipelines #207
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Measurement pipe
per
nounit
in that case). This is also the case for percentages : they have a dim ofnounit
and a scale of0.01
ASAT ¦U/L ¦216 + ¦7-40
, 7-40 is not matched)measure_before_unit
variable which lets the user indicate if the unit is generally before or after the unit. This is especially useful when considering stopwords between numerical values and units (eg in the linemg | 5 | mL | 0.3
, with "|" as stopword and measure_before_unit set toFalse
, the extracted ents will be5mg
and0.3mL
. If measure_before_unit was set toTrue
, only the wrong measurement5mL
will be extracted)measurements
attribute isNone
is to match all possible measurements. In that case, all measurements are labeled "eds.measurement", even the one which were initially recognised by other defaultmeasurements
(such aseds.weight
)SimpleMeasurement
class to store this rangeSimpleMeasurement
class changed to addpandas
displaying supportunit_config
: degrees and dim are now stored in a subdictionnary so that the user can store a unit with multiple dimensions (useful for egmmHg
)1
always refers to an unit of the international system unitper
associate, even if this one was already mentionned by the userper
based on one unit not starting withper
, some default terms are added based on the ones of the latter unitSimpleMeasurement
object withobject.ui
SimpleMeasurement
objectsall_measurements
variable to let the user choose whether he still wants to match all measures or only the ones he mentions. If set True, the matched measurements not requested by the user will be labelededs.measurements
and the ones requested will have the name that was defined by the user.parse_doc
variable to let the user choose if he wants to parse the doc without the tables (True) or nothing (False)parse_tables
variable to let the user choose if he wants to parse the tables (True) or not (False)measurements
variable now acceptsvalueless_patterns
in addition ofunitless patterns
. This lets the user hardcode some measures which may not be detected by the measurements pipe. It is especially useful in tables when a measure is not a numerical value (eg. positive, negative)Table pipe
table
attribute which contains a dictionnary with column names, row names or column index as keycol_names
androw_names
to let the user specify if column / row names are detected by the regex table patternto_pd_table
now acceptsas_span
attribute. When set to True, pandas table contains spans. When set to False, the pandas table contains strings.Checklist
eds.measurement
as default name instead ofeds.size
)