Commit d9c13cf6 authored by Stéphan Bernard's avatar Stéphan Bernard
Browse files

Corrections sur le plan BBCH.

No related merge requests found
Showing with 42 additions and 28 deletions
+42 -28
......@@ -37,9 +37,10 @@
@skos-prefLabel;
@canonical-form;
<!-- context before -->
str:normalizeSpace(str:sub(section.contents, m:max(0, start - 20), start));
<!-- str:normalizeSpace(str:sub(section.contents, m:max(0, start - 20), start)); -->
str:seds(str:normalizeSpace(str:sub(section.contents, m:max(0, start - 20), start)), "\"", "'");
<!-- context after -->
str:normalizeSpace(str:sub(section.contents, end, m:min(end + 20, str:len(section.contents))));
str:seds(str:normalizeSpace(str:sub(section.contents, end, m:min(end + 20, str:len(section.contents)))), "\"", "'");
<!-- location -->
start ^ "-" ^ end;
<!-- number of words -->
......
......@@ -55,7 +55,7 @@
<pattern>
[ @form =^ "BBCH" ]
[ @form == "-"]?
[ @form =~ "[0-9]{2}" and @form =^ ")" ]
[ @form =~ "[0-9]{2}" and @form =^ ")" ]
</pattern>
<actions>
<createAnnotation layer="bbch"/>
......@@ -92,7 +92,7 @@
[ @form ^= "BBCH" ]
[ @form == ":" ]
[ @form ^= "Stade" ]
(number2 : [ @form =~ "[0-9]{2}" ])
(number2 : [ @form =~ "\\d{2}$" ])
</pattern>
<actions>
<createAnnotation layer="bbch" features='canonical-form=("BBCH " ^ group:number2)'/>
......@@ -108,19 +108,34 @@
<pattern>
[ @form == "BBCH" ]
[ @form == "-"]?
(number3 : [ @form =~ "[0-9]{2}" ])
(number3 : [ @form =~ "\\d{2}$" ])
[@form == "à" or @form == "-"]
(number4 : [ @form =~ "[0-9]{2}" ])
(number4 : [ @form =~ "\\d{2}$" ])
</pattern>
<actions>
<createAnnotation layer="bbch" features='number=group:number3,canonical-form=("BBCH " ^ group:number3)'/>
<createAnnotation layer="bbch" features='number=group:number4,canonical-form=("BBCH " ^ group:number4)'/>
<createAnnotation layer="bbch" features='number=(group:number3 =~ "..$"),canonical-form=("BBCH " ^ (group:number3 =~ "..$"))'/>
<createAnnotation layer="bbch" features='number=(group:number4 =~ "..$"),canonical-form=("BBCH " ^ (group:number4 =~ "..$"))'/>
</actions>
<constantAnnotationFeatures>type=BBCH_RANGE</constantAnnotationFeatures>
</BBCH_RANGE>
<!-- BBCH 13-17 -->
<!-- Sans espace contenu dans "13-17" le pattern est différent de BBCH_RANGE -->
<BBCH_RANGE_GLUED class="PatternMatcher">
<pattern>
[ @form == "BBCH" ]
[ @form == "-"]?
(number3bis : [ @form =~ "\\d{2}-\\d{2}$" ])
</pattern>
<actions>
<createAnnotation layer="bbch" features='number=(group:number3bis =~ "^.."),canonical-form=("BBCH " ^ (group:number3bis =~ "^.."))'/>
<createAnnotation layer="bbch" features='number=(group:number3bis =~ "..$"),canonical-form=("BBCH " ^ (group:number3bis =~ "..$"))'/>
</actions>
<constantAnnotationFeatures>type=BBCH_RANGE</constantAnnotationFeatures>
</BBCH_RANGE_GLUED>
<!-- BBCH-69 et 73 -->
<!-- BBCH 13, 18 ou 32 -->
......@@ -128,18 +143,18 @@
<pattern>
[ @form =^ "BBCH" ]
[ @form == "-"]?
(number5 : [ @form =~ "[0-9]{2}" ])
(number5 : [ @form =~ "\\d{2}$" ])
[@lemma == "et" or @lemma == "ou" or @lemma == ","]
(number6 : [ @form =~ "[0-9]{2}" ])
(number6 : [ @form =~ "\\d{2}$" ])
[@lemma == "et" or @lemma == "ou" or @lemma == ","]?
(number7 : [ @form =~ "[0-9]{2}" ])?
(number7 : [ @form =~ "\\d{2}$" ])?
</pattern>
<actions>
<createAnnotation layer="bbch" features='canonical-form=("BBCH " ^ group:number5)'/>
<createAnnotation layer="bbch" features='canonical-form=("BBCH " ^ group:number6)'/>
<createAnnotation layer="bbch" features='canonical-form=("BBCH " ^ group:number7)'/>
<createAnnotation layer="bbch" features='canonical-form=("BBCH " ^ (group:number5 =~ "..$"))'/>
<createAnnotation layer="bbch" features='canonical-form=("BBCH " ^ (group:number6 =~ "..$"))'/>
<createAnnotation layer="bbch" features='canonical-form=("BBCH " ^ (group:number7 =~ "..$"))'/>
</actions>
<constantAnnotationFeatures>type=BBCH_DD_KON_DD</constantAnnotationFeatures>
</BBCH_DD_KON_DD>
......@@ -156,14 +171,14 @@
[ @form == "à" ]
[ @form == "100" ]
[ @form == ")" ]
(number8 : [ @form =~ "[0-9]{2}" ])
(number9 : [ @form =~ "[0-9]{2}" ])?
(number10 : [ @form =~ "[0-9]{2}" ])?
(number8 : [ @form =~ "[0-9]{2}$" ])
(number9 : [ @form =~ "[0-9]{2}$" ])?
(number10 : [ @form =~ "[0-9]{2}$" ])?
</pattern>
<actions>
<createAnnotation layer="bbch" features='canonical-form=("BBCH " ^ group:number8)'/>
<createAnnotation layer="bbch" features='canonical-form=("BBCH " ^ group:number9)'/>
<createAnnotation layer="bbch" features='canonical-form=("BBCH " ^ group:number10)'/>
<createAnnotation layer="bbch" features='canonical-form=("BBCH " ^ (group:number8 =~ "..$"))'/>
<createAnnotation layer="bbch" features='canonical-form=("BBCH " ^ (group:number9 =~ "..$"))'/>
<createAnnotation layer="bbch" features='canonical-form=("BBCH " ^ (group:number10 =~ "..$"))'/>
</actions>
<constantAnnotationFeatures>type=BBCH_TABLE</constantAnnotationFeatures>
</BBCH_TABLE>
......
<?xml version="1.0" encoding="UTF-8"?>
<alvisnlp-plan id="preprocess">
<!-- segment text to phrases and tokenize -->
<import>resources/segmentation/segmentation.plan</import>
<import href ="resources/segmentation/segmentation.plan" />
<!-- set correct pos tags for some nouns -->
<correct-plants class="Action">
......@@ -24,8 +22,8 @@
<tt class="TreeTagger">
<!-- global configs for treetagger -->
<!-- Change to your own local paths -->
<treeTaggerExecutable>/home/stef/opt/share/alvisnlp/treetagger/bin/tree-tagger</treeTaggerExecutable>
<parFile>/home/stef/opt/share/alvisnlp/treetagger/lib/french.par</parFile>
<treeTaggerExecutable>/home/stef/opt/share/alvisnlp.externalTools/treetagger/bin/tree-tagger</treeTaggerExecutable>
<parFile>/home/stef/opt/share/alvisnlp.externalTools/treetagger/lib/french.par</parFile>
<!-- parameters -->
<noUnknownLemma/>
<inputCharset>UTF-8</inputCharset>
......
......@@ -154,7 +154,7 @@
<!-- create a correspondance between matches and real concepts from ppdo-->
<source>resources/thesaurus/ppdo/ppdo_20210726.rdf</source>
<subject layer="baggiolini" feature="canonical-form"/>
<targetLayerName>ppdo-baseline</targetLayerName>
<targetLayerName>ppdo-baseline-DISABLE</targetLayerName>
<!-- information that has to be saved and added to the baseline layer-->
<resourceTypeURIs>owl:NamedIndividual</resourceTypeURIs>
<language>fr</language>
......@@ -175,7 +175,7 @@
<!-- create a correspondance between matches and real concepts from ppdo-->
<source>resources/thesaurus/ppdo/ppdo_20210726.rdf</source>
<subject layer="eicchorn-lorenz" feature="canonical-form"/>
<targetLayerName>ppdo-baseline</targetLayerName>
<targetLayerName>ppdo-baseline-DISABLE</targetLayerName>
<!-- information that has to be saved and added to the baseline layer-->
<resourceTypeURIs>owl:NamedIndividual</resourceTypeURIs>
<language>fr</language>
......@@ -191,7 +191,7 @@
<filter>
<overlaps class="RemoveOverlaps">
<layerName>ppdo-baseline</layerName>
<removeEqual/>
<removeEqual>false</removeEqual>
<removeIncluded>false</removeIncluded>
<removeOverlapping>true</removeOverlapping>
</overlaps>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment