Package org.apache.stanbol.enhancer.nlp.pos

Examples of org.apache.stanbol.enhancer.nlp.pos.LexicalCategory


        if(!tag.isTextual()){
            throw new IllegalStateException("Unable to parse PhraseTag. The value of the "
                    +"'tag' field MUST have a textual value (json: "+jValue+")");
        }
        JsonNode jCat = jValue.path("lc");
        LexicalCategory lc = null;
        if(jCat.isTextual()){
            try {
                lc = LexicalCategory.valueOf(jCat.getTextValue());
            } catch (IllegalArgumentException e) {
                log.warn("Unable to parse category for PhraseTag from '"
View Full Code Here


                    Double weight = Double.valueOf(components[1]);

                    // get the main word
                    String[] wordPart = components[0].split("\\|");
                    String mainWord = wordPart[0];
                    LexicalCategory cat = getLexicalCategory(wordPart[1]);
                    dict.updateSentiment(cat, mainWord, weight);

                    // get the remaining words (deflections)
                    if(components.length > 2) {
                        for(String word : components[2].split(",")) {
View Full Code Here

                    line = line.trim();
                    if (line.length() > 0 && line.charAt(0) != '#') {
                        String[] components = line.split("\t");
   
                        try {
                            LexicalCategory cat = parseLexCat(components[0]);
                            double posScore = Double.parseDouble(components[2]);
                            double negScore = Double.parseDouble(components[3]);
                            String synonyms = components[4];
   
                            Double score = posScore - negScore;
View Full Code Here

            assertTrue("Morpho Feature value are expected of typed literal", morphoFeature instanceof UriRef);
            String feature=((UriRef)morphoFeature).getUnicodeString();
            assertFalse("Morpho Feature MUST NOT be empty",feature.isEmpty());
            if(feature.startsWith(OLIA_NAMESPACE)){
              String key=feature.substring(OLIA_NAMESPACE.length());
              LexicalCategory cat=LexicalCategory.valueOf(key);
              assertTrue("Part of Speech of "+TERM+" should be "+LexicalCategory.Noun , (cat==LexicalCategory.Noun));
            }
        }
        morphoFeatureIterator = enhancements.filter(textAnnotation, CeliMorphoFeatures.HAS_GENDER, null);
        assertTrue("No Gender Morpho Feature value found for TextAnnotation "+textAnnotation+"!", morphoFeatureIterator.hasNext());
View Full Code Here

        if(!tag.isTextual()){
            throw new IllegalStateException("Unable to parse PhraseTag. The value of the "
                    +"'tag' field MUST have a textual value (json: "+jValue+")");
        }
        JsonNode jCat = jValue.path("lc");
        LexicalCategory lc = null;
        if(jCat.isTextual()){
            try {
                lc = LexicalCategory.valueOf(jCat.getTextValue());
            } catch (IllegalArgumentException e) {
                log.warn("Unable to parse category for PhraseTag from '"
View Full Code Here

            assertTrue("Morpho Feature value are expected of typed literal", morphoFeature instanceof UriRef);
            String feature=((UriRef)morphoFeature).getUnicodeString();
            assertFalse("Morpho Feature MUST NOT be empty",feature.isEmpty());
            if(feature.startsWith(OLIA_NAMESPACE)){
              String key=feature.substring(OLIA_NAMESPACE.length());
              LexicalCategory cat=LexicalCategory.valueOf(key);
              assertTrue("Part of Speech of "+TERM+" should be "+LexicalCategory.Noun , (cat==LexicalCategory.Noun));
            }
        }
        morphoFeatureIterator = enhancements.filter(textAnnotation, CeliMorphoFeatures.HAS_GENDER, null);
        assertTrue("No Gender Morpho Feature value found for TextAnnotation "+textAnnotation+"!", morphoFeatureIterator.hasNext());
View Full Code Here

TOP

Related Classes of org.apache.stanbol.enhancer.nlp.pos.LexicalCategory

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.