2016-08-24 48 views
2

林taging HyphenizationWord像脫線,新的列表,VBSE-in..etc使用UIMA魯塔不一致字

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

,我總是要標記像脫線,新list..etc話。 但是我的腳本錯誤地歪曲了一些詞,如VBSE行。

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

有什麼辦法來糾正我的問題..

回答

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魯塔的

開發商