ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chen...@apache.org
Subject svn commit: r1500985 - in /ctakes/trunk/ctakes-pos-tagger: desc/POSTagger.xml src/main/java/org/apache/ctakes/postagger/POSTagger.java
Date Mon, 08 Jul 2013 22:07:44 GMT
Author: chenpei
Date: Mon Jul  8 22:07:43 2013
New Revision: 1500985

URL: http://svn.apache.org/r1500985
Log:
CTAKES-97 - Since OpenNLP 1.5+, there is no need to load up the tag dictionary anymore.
Removing unncessary/unused bit of code.

Modified:
    ctakes/trunk/ctakes-pos-tagger/desc/POSTagger.xml
    ctakes/trunk/ctakes-pos-tagger/src/main/java/org/apache/ctakes/postagger/POSTagger.java

Modified: ctakes/trunk/ctakes-pos-tagger/desc/POSTagger.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-pos-tagger/desc/POSTagger.xml?rev=1500985&r1=1500984&r2=1500985&view=diff
==============================================================================
--- ctakes/trunk/ctakes-pos-tagger/desc/POSTagger.xml (original)
+++ ctakes/trunk/ctakes-pos-tagger/desc/POSTagger.xml Mon Jul  8 22:07:43 2013
@@ -36,19 +36,6 @@
 <multiValued>false</multiValued>
 <mandatory>true</mandatory>
 </configurationParameter>
-<configurationParameter>
-<name>TagDictionary</name>
-<description>The file contains a list of words, and for each word, the set of part
of speech tags to be considered for that word. For words in the tag dictionary, only the corresponding
tags in the tag dictionary are considered when tagging the word with a part of speech.</description>
-<type>String</type>
-<multiValued>false</multiValued>
-<mandatory>false</mandatory>
-</configurationParameter>
-<configurationParameter>
-<name>CaseSensitive</name>
-<type>Boolean</type>
-<multiValued>false</multiValued>
-<mandatory>false</mandatory>
-</configurationParameter>
 </configurationParameters>
 <configurationParameterSettings>
 <nameValuePair>
@@ -57,18 +44,6 @@
 <string>org/apache/ctakes/postagger/models/mayo-pos.zip</string>
 </value>
 </nameValuePair>
-<nameValuePair>
-<name>CaseSensitive</name>
-<value>
-<boolean>true</boolean>
-</value>
-</nameValuePair>
-<nameValuePair>
-<name>TagDictionary</name>
-<value>
-<string>org/apache/ctakes/postagger/models/tag.dictionary.txt</string>
-</value>
-</nameValuePair>
 </configurationParameterSettings>
 <typeSystemDescription>
 <imports>

Modified: ctakes/trunk/ctakes-pos-tagger/src/main/java/org/apache/ctakes/postagger/POSTagger.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-pos-tagger/src/main/java/org/apache/ctakes/postagger/POSTagger.java?rev=1500985&r1=1500984&r2=1500985&view=diff
==============================================================================
--- ctakes/trunk/ctakes-pos-tagger/src/main/java/org/apache/ctakes/postagger/POSTagger.java
(original)
+++ ctakes/trunk/ctakes-pos-tagger/src/main/java/org/apache/ctakes/postagger/POSTagger.java
Mon Jul  8 22:07:43 2013
@@ -89,41 +89,6 @@ public class POSTagger extends JCasAnnot
 	 */
 	public static final String POS_MODEL_FILE_PARAM = "PosModelFile";
 
-	/**
-	 * "TagDictionary" is an optional, single, string parameter that contains
-	 * the file name of the part-of-speech tag dictionary. For relevant
-	 * discussion of the difference between a "tag dictionary" and a
-	 * "dictionary" see:
-	 * <p><ul>
-	 * <li>
-	 * <a href="https://sourceforge.net/forum/forum.php?thread_id=1720863&forum_id=9943">PosTagger
- with/without dictionaries? and ..</a>
-	 * <li> 
-	 * </li>
-	 * <a href="https://sourceforge.net/forum/forum.php?thread_id=1894043&forum_id=9943">Create
a new dict file</a>
-	 * </li>
-	 * </ul>
-	 * For information about how to create a TagDictionary, please see the
-	 * README in top-level directory of this project.
-	 * 
-	 * @see TagDictionary
-	 * @see POSDictionary
-	 */
-	public static final String TAG_DICTIONARY_PARAM = "TagDictionary";
-
-	/**
-	 * "CaseSensitive" is a required, single, boolean parameter that specifies
-	 * how to access entries in the tag dictionary. If you give the value
-	 * "false", then you should really have a tag dictionary that is also case
-	 * insensitive. Please see the README in top-level directory of this project
-	 * for details on how to create a case insensitive tag dictionary.
-	 * 
-	 * <br>
-	 * This parameter has no effect if no tag dictionary is provided but is
-	 * required if a tag dictionary is provided.
-	 * 
-	 * @see POSDictionary#POSDictionary(String, boolean)
-	 * 
-	 */
 	public static final String CASE_SENSITIVE_PARAM = "CaseSensitive";
 
 	private opennlp.tools.postag.POSTaggerME tagger;
@@ -139,20 +104,6 @@ public class POSTagger extends JCasAnnot
 			String modelFileAbsPath = posModelFile.getAbsolutePath();
 			logger.info("POS tagger model file: " + modelFileAbsPath);
 
-			boolean caseSensitive = (Boolean) uimaContext.getConfigParameterValue(CASE_SENSITIVE_PARAM);
-			String tagDictionaryPath = (String) uimaContext.getConfigParameterValue(TAG_DICTIONARY_PARAM);
-
-			TagDictionary tagDictionary = null;
-			if (tagDictionaryPath != null && !tagDictionaryPath.trim().equals("")) {
-				File tagDictFile = FileLocator.locateFile(tagDictionaryPath);
-				String tagDictFileAbsPath = tagDictFile.getAbsolutePath();
-				logger.info("POS tagger tag-dictionary: " + tagDictFileAbsPath);
-
-				tagDictionary = new POSDictionary(tagDictFileAbsPath, caseSensitive);
-			} else {
-				logger.info("No POS tagger tag-dictionary.");
-			}
-
 			FileInputStream fis = new FileInputStream(posModelFile);
 			POSModel modelFile = new POSModel(fis); // skip using the tag dictionary for now since
OpenNLP (1.5) changed
 			tagger = new opennlp.tools.postag.POSTaggerME(modelFile); //, tagDictionary);



Mime
View raw message