Revision: 7319
http://languagetool.svn.sourceforge.net/languagetool/?rev=7319&view=rev
Author: milek_pl
Date: 2012-06-11 17:39:10 +0000 (Mon, 11 Jun 2012)
Log Message:
-----------
annotate multiword chunker as well
Modified Paths:
--------------
trunk/JLanguageTool/src/java/org/languagetool/tagging/disambiguation/MultiWordChunker.java
Modified:
trunk/JLanguageTool/src/java/org/languagetool/tagging/disambiguation/MultiWordChunker.java
===================================================================
---
trunk/JLanguageTool/src/java/org/languagetool/tagging/disambiguation/MultiWordChunker.java
2012-06-11 17:02:15 UTC (rev 7318)
+++
trunk/JLanguageTool/src/java/org/languagetool/tagging/disambiguation/MultiWordChunker.java
2012-06-11 17:39:10 UTC (rev 7319)
@@ -131,11 +131,17 @@
if (mFull.containsKey(tokens.toString())) {
final AnalyzedToken tokenStart = new AnalyzedToken(tok, "<"
+ mFull.get(tokens.toString()) + ">", tokens.toString());
+ String oldReading = output[i].toString();
output[i].addReading(tokenStart);
+ output[i].setHistoricalAnnotations("MULTIWORD_CHUNKER"
+ + ": " + oldReading + " -> " + output[i].toString());
final AnalyzedToken tokenEnd = new AnalyzedToken(
anTokens[finalLen].getToken(), "</"
+ mFull.get(tokens.toString()) + ">",
tokens.toString());
+ oldReading = output[finalLen].toString();
output[finalLen].addReading(tokenEnd);
+ output[finalLen].setHistoricalAnnotations("MULTIWORD_CHUNKER"
+ + ": " + oldReading + " -> " + output[i].toString());
}
lenCounter++;
if (lenCounter == len) {
@@ -156,12 +162,18 @@
if (mFull.containsKey(tokens.toString())) {
final AnalyzedToken tokenStart = new AnalyzedToken(tok, "<"
+ mFull.get(tokens.toString()) + ">", tokens.toString());
+ String oldReading = output[i].toString();
output[i].addReading(tokenStart);
+ output[i].setHistoricalAnnotations("MULTIWORD_CHUNKER"
+ + ": " + oldReading + " -> " + output[i].toString());
final AnalyzedToken tokenEnd = new AnalyzedToken(anTokens
[i + len - 1].getToken(),
"</" + mFull.get(tokens.toString()) + ">",
tokens.toString());
+ oldReading = output[i + len - 1].toString();
output[i + len - 1].addReading(tokenEnd);
+ output[i + len - 1].setHistoricalAnnotations("MULTIWORD_CHUNKER"
+ + ": " + oldReading + " -> " + output[i].toString());
}
}
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Languagetool-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-cvs