Package opennlp.tools.postag

Examples of opennlp.tools.postag.TagDictionary


      }
    }

    if (params.getTagDictCutoff() != null) {
      try {
        TagDictionary dict = postaggerFactory.getTagDictionary();
        if (dict == null) {
          dict = postaggerFactory.createEmptyTagDictionary();
          postaggerFactory.setTagDictionary(dict);
        }
        if (dict instanceof MutableTagDictionary) {
View Full Code Here


      }
    }

    if (params.getTagDictCutoff() != null) {
      try {
        TagDictionary dict = postaggerFactory.getTagDictionary();
        if (dict == null) {
          dict = postaggerFactory.createEmptyTagDictionary();
          postaggerFactory.setTagDictionary(dict);
        }
        if (dict instanceof MutableTagDictionary) {
View Full Code Here

          File f = new File(d, "pos.model.bin");
          //File f = new File(d, "tag.bin.gz");
          MaxentModel posModel = new opennlp.maxent.io.SuffixSensitiveGISModelReader(f).getModel();
          if (useTagDictionary) {
            File td = new File(d, "tagdict");
            TagDictionary tagDictionary = new POSDictionary(td.getAbsolutePath()); //null;
            posTagger = new POSTaggerME((AbstractModel) posModel, tagDictionary);
          } else {
            // f = new File(d, "dict.bin.gz");
            Dictionary dictionary = null; // new Dictionary();
            posTagger = new POSTaggerME((AbstractModel) posModel, dictionary);
View Full Code Here

      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);
View Full Code Here

TOP

Related Classes of opennlp.tools.postag.TagDictionary

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.