Skip to content

edsnlp.pipelines.ner.scores.tnm.patterns

modifier_pattern = '(?P<modifier>[cpyraum])' module-attribute

tumour_pattern = 't\\s?(?P<tumour>([0-4o]|is|x))x?' module-attribute

node_pattern = 'n\\s?(?P<node>[0-3o]|x)x?' module-attribute

metastasis_pattern = 'm\\s?(?P<metastasis>[01o]|x)x?' module-attribute

version_pattern = '\\(?(?P<version>uicc|accj|tnm)\\s+([ée]ditions|[ée]d\\.?)?\\s*(?P<version_year>\\d{4}|\\d{2})\\)?' module-attribute

spacer = '(.|\\n){1,5}' module-attribute

tnm_pattern = '(?<={version_pattern}{spacer})?' module-attribute