Uima Ruta不一致的词



我正在标记HyphenizationWord Like off-line,New-list,VBSE-in..等使用

(SW|CW|CAP) HYPHEN (SW|CW|CAP) HYPHEN (SW|CW|CAP) {-PARTOF(HyphenizationWord) ->MARK(ThreeHyphenizationWord,1,5)};
(SW|CW|CAP) HYPHEN (SW|CW|CAP)  {-PARTOF(HyphenizationWord),-PARTOF(ThreeHyphenizationWord) ->MARK(HyphenizationWord,1,3),MARK(PreHyphenizationWords,1),MARK(PosHyphenixationWords,3)};

我总是想标记词,如离线,新列表…等。但是我的脚本错误地标记了一些单词,比如…off in,VBSE line.

DECLARE ComplexPreWord,ComplexPostWord;
//BLOCK (foreach) HyphenizationWord{}
//{
 STRING PreWord;
STRINGLIST PreWordList;
PreHyphenizationWords{-   >MATCHEDTEXT(PreWord),ADD(PreWordList,PreWord)};
W {INLIST(PreWordList)->ComplexPreWord};
STRING PostWord;
STRINGLIST PostWordList;
PosHyphenixationWords{- >MATCHEDTEXT(PostWord),ADD(PostWordList,PostWord)};
W {INLIST(PostWordList)->ComplexPostWord};
//}
ComplexPreWord ComplexPostWord{->MARK(ComplexWord,1,2)};

There is any Way To纠正我的问题

我不知道我是否正确理解了你的问题,但也许这就是你想要的:

DECLARE Hyphen;
SPECIAL.ct == "-"{-> Hyphen};
DECLARE HyphenizationWord, PreHyphenizationWords, PosHyphenixationWords;
DECLARE HyphenizationWord ThreeHyphenizationWord;
(W @Hyphen{-PARTOF(HyphenizationWord)} W Hyphen W){-> ThreeHyphenizationWord};
(W{-> PreHyphenizationWords} @Hyphen{-PARTOF(HyphenizationWord)} W{-> PosHyphenixationWords}){-> HyphenizationWord};
STRINGLIST hyphenizationWordList;
STRING mt;
HyphenizationWord{-> MATCHEDTEXT(mt), ADD(hyphenizationWordList, replaceAll(mt, "[- ]", ""))};
DECLARE ComplexWord;
MARKFAST(ComplexWord,hyphenizationWordList);

脚本从你的规则开始(重写)。然后,HyphenizationWord注释包含的文本存储在一个列表中,但是破折号和空格会事先删除。然后,使用MARKFAST简单地在字典查找中使用此列表。

免责声明:我是UIMA Ruta的开发人员

最新更新