You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by jo...@apache.org on 2014/03/13 15:42:10 UTC

svn commit: r1577178 - /opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/postag/POSTaggerME.java

Author: joern
Date: Thu Mar 13 14:42:10 2014
New Revision: 1577178

URL: http://svn.apache.org/r1577178
Log:
OPENNLP-663 Added a method to retrieve all possible pos tags.

Modified:
    opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/postag/POSTaggerME.java

Modified: opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/postag/POSTaggerME.java
URL: http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/postag/POSTaggerME.java?rev=1577178&r1=1577177&r2=1577178&view=diff
==============================================================================
--- opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/postag/POSTaggerME.java (original)
+++ opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/postag/POSTaggerME.java Thu Mar 13 14:42:10 2014
@@ -131,7 +131,9 @@ public class POSTaggerME implements POST
    * Returns the number of different tags predicted by this model.
    *
    * @return the number of different tags predicted by this model.
+   * @deprecated use getAllPosTags instead!
    */
+  @Deprecated
   public int getNumTags() {
     
     // TODO: Lets discuss on the dev list how to do this properly!
@@ -140,7 +142,15 @@ public class POSTaggerME implements POST
     return model.getOutcomes().length;
   }
 
-  // TODO: Add method to get tags ?! 
+  /**
+   * Retrieves an array of all possible part-of-speech tags from the
+   * tagger.
+   * 
+   * @return
+   */
+  public String[] getAllPosTags() {
+    return model.getOutcomes();
+  }
   
   @Deprecated
   public List<String> tag(List<String> sentence) {