2

我标记连字符字像离线,新列表,VBSE-in..etc 使用

(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)};

而且我总是想标记离线,新列表等单词。但是我的脚本错误地在 VBSE 行中标记了一些单词 Like..off。

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)};

有什么办法可以纠正我的问题..

4

1 回答 1

2

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

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 的开发人员

于 2016-08-25T06:31:44.207 回答