Revision: 7177
http://languagetool.svn.sourceforge.net/languagetool/?rev=7177&view=rev
Author: milek_pl
Date: 2012-06-02 18:28:49 +0000 (Sat, 02 Jun 2012)
Log Message:
-----------
bug fix: removeReading should not remove everything from AnalyzedTokenReading
Modified Paths:
--------------
trunk/JLanguageTool/src/java/org/languagetool/AnalyzedTokenReadings.java
Modified:
trunk/JLanguageTool/src/java/org/languagetool/AnalyzedTokenReadings.java
===================================================================
--- trunk/JLanguageTool/src/java/org/languagetool/AnalyzedTokenReadings.java
2012-06-02 18:02:04 UTC (rev 7176)
+++ trunk/JLanguageTool/src/java/org/languagetool/AnalyzedTokenReadings.java
2012-06-02 18:28:49 UTC (rev 7177)
@@ -159,6 +159,12 @@
setNoRealPOStag();
}
+ /**
+ * Removes a reading from the list of readings. Note: if the token
+ * has only one reading, then a new reading with an empty POS tag
+ * and an empty lemma is created.
+ * @param token - reading to be removed.
+ */
public final void removeReading(final AnalyzedToken token) {
final ArrayList<AnalyzedToken> l = new ArrayList<AnalyzedToken>();
final AnalyzedToken tmpTok = new AnalyzedToken(token.getToken(), token
@@ -169,6 +175,9 @@
l.add(anTokReading);
}
}
+ if (l.isEmpty()) {
+ l.add(new AnalyzedToken(token.getToken(), null, null));
+ }
anTokReadings = l.toArray(new AnalyzedToken[l.size()]);
setNoRealPOStag();
}
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