Package opennlp.tools.postag

Examples of opennlp.tools.postag.POSTagger


    }
    @Test
    public void testLoadEnPOS() throws IOException{
        POSModel model = openNLP.getPartOfSpeachModel("en");
        Assert.assertNotNull(model);
        POSTagger posTagger = openNLP.getPartOfSpeechTagger("en");
        Assert.assertNotNull(posTagger);
    }
View Full Code Here


    }
    @Test
    public void testLoadMissingPOS() throws IOException{
        POSModel model = openNLP.getPartOfSpeachModel("ru");
        Assert.assertNull(model);
        POSTagger posTagger = openNLP.getPartOfSpeechTagger("ru");
        Assert.assertNull(posTagger);
    }
View Full Code Here

     
      File d = new File(dataDir);
     
      MaxentModel buildModel = null;
      MaxentModel checkModel = null;
      POSTagger posTagger = null;
      Chunker chunker = null;
      HeadRules headRules = null;

      if (!d.isDirectory()) {
        FileInputStream fis = new FileInputStream(d);
View Full Code Here

    @Override
    public void computeEnhancements(ContentItem ci) throws EngineException {
        AnalysedText at = initAnalysedText(this,analysedTextFactory,ci);
        String language = getLanguage(this, ci, true);
       
        POSTagger posTagger = getPOSTagger(language);
        if(posTagger == null){
            //this means that the POS tagger became unavailable in-between
            //the call to canEnhance and computeEnhancement
            throw new EngineException("PosTagger for langauge '"+language
                + "is not available.");
View Full Code Here

TOP

Related Classes of opennlp.tools.postag.POSTagger

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.