Codota Logo
EnglishMorphAnalyzer
Code IndexAdd Codota to your IDE (free)

How to use
EnglishMorphAnalyzer
in
edu.emory.mathcs.nlp.component.morph.english

Best Java code snippets using edu.emory.mathcs.nlp.component.morph.english.EnglishMorphAnalyzer (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: emorynlp/nlp4j

public MorphologicalAnalyzer(Language language)
{
  analyzer = new EnglishMorphAnalyzer();
}
origin: emorynlp/nlp4j

@Override
public String lemmatize(String simplifiedWordForm, String pos)
{
  String lemma = StringUtils.toLowerCase(simplifiedWordForm), t;
  
  if ((t = getAbbreviation(lemma, pos)) != null || (t = getBaseFormFromInflection(lemma, pos)) != null)
    lemma = t;
  
  if      (isCardinal(lemma))	return MetaConst.CARDINAL;
  else if (isOrdinal (lemma))	return MetaConst.ORDINAL;
  
  return lemma;
}

origin: emorynlp/nlp4j

/** Constructs an English morphological analyzer from the dictionary in resource. */
public EnglishMorphAnalyzer()
{
  Element inflection = XMLUtils.getDocumentElement(IOUtils.getInputStreamsFromResource(INFLECTION_SUFFIX));
  Element derivationN2V = XMLUtils.getDocumentElement(IOUtils.getInputStreamsFromResource(DERIVATION_SUFFIX_N2V));
  
  try
  {
    inf_verb      = getInflectionRules(inflection, VERB     , VERB_POS);
    inf_noun      = getInflectionRules(inflection, NOUN     , NOUN_POS);
    inf_adjective = getInflectionRules(inflection, ADJECTIVE, ADJECTIVE_POS);
    inf_adverb    = getInflectionRules(inflection, ADVERB   , ADVERB_POS);
    
    der_n2v = getDerivationalRules(derivationN2V, NOUN);
    
    base_cardinal     = DSUtils.createStringHashSet(IOUtils.getInputStreamsFromResource(CARDINAL_BASE));
    base_ordinal      = DSUtils.createStringHashSet(IOUtils.getInputStreamsFromResource(ORDINAL_BASE));
    rule_abbreviation = getAbbreviationMap(IOUtils.getInputStreamsFromResource(ABBREVIATOIN_RULE));
  }
  catch (IOException e) {e.printStackTrace();}
}

origin: edu.emory.mathcs.nlp/nlp4j-morphology

/** Called by {@link #EnglishLemmatizer()}. */
private EnglishInflection getInflectionRules(Element eInflection, String type, String basePOS) throws IOException
{
  Element     eAffixes        = XMLUtils.getFirstElementByTagName(eInflection, type);
  InputStream baseStream      = IOUtils.getInputStreamsFromResource(ROOT + type + EXT_BASE);
  InputStream exceptionStream = IOUtils.getInputStreamsFromResource(ROOT + type + EXT_EXCEPTION);
  
  return getInflection(baseStream, exceptionStream, eAffixes, basePOS);
}

origin: edu.emory.mathcs.nlp/nlp4j-morphology

/** Constructs an English morphological analyzer from the dictionary in resource. */
public EnglishMorphAnalyzer()
{
  Element inflection = XMLUtils.getDocumentElement(IOUtils.getInputStreamsFromResource(INFLECTION_SUFFIX));
  Element derivationN2V = XMLUtils.getDocumentElement(IOUtils.getInputStreamsFromResource(DERIVATION_SUFFIX_N2V));
  
  try
  {
    inf_verb      = getInflectionRules(inflection, VERB     , VERB_POS);
    inf_noun      = getInflectionRules(inflection, NOUN     , NOUN_POS);
    inf_adjective = getInflectionRules(inflection, ADJECTIVE, ADJECTIVE_POS);
    inf_adverb    = getInflectionRules(inflection, ADVERB   , ADVERB_POS);
    
    der_n2v = getDerivationalRules(derivationN2V, NOUN);
    
    base_cardinal     = DSUtils.createStringHashSet(IOUtils.getInputStreamsFromResource(CARDINAL_BASE));
    base_ordinal      = DSUtils.createStringHashSet(IOUtils.getInputStreamsFromResource(ORDINAL_BASE));
    rule_abbreviation = getAbbreviationMap(IOUtils.getInputStreamsFromResource(ABBREVIATOIN_RULE));
  }
  catch (IOException e) {e.printStackTrace();}
}

origin: emorynlp/nlp4j

/** Called by {@link #EnglishLemmatizer()}. */
private EnglishInflection getInflectionRules(Element eInflection, String type, String basePOS) throws IOException
{
  Element     eAffixes        = XMLUtils.getFirstElementByTagName(eInflection, type);
  InputStream baseStream      = IOUtils.getInputStreamsFromResource(ROOT + type + EXT_BASE);
  InputStream exceptionStream = IOUtils.getInputStreamsFromResource(ROOT + type + EXT_EXCEPTION);
  
  return getInflection(baseStream, exceptionStream, eAffixes, basePOS);
}

origin: edu.emory.mathcs.nlp/nlp4j-morphology

@Override
public String lemmatize(String simplifiedWordForm, String pos)
{
  String lemma = StringUtils.toLowerCase(simplifiedWordForm), t;
  
  if ((t = getAbbreviation(lemma, pos)) != null || (t = getBaseFormFromInflection(lemma, pos)) != null)
    lemma = t;
  
  if      (isCardinal(lemma))	return MetaConst.CARDINAL;
  else if (isOrdinal (lemma))	return MetaConst.ORDINAL;
  
  return lemma;
}

origin: emorynlp/nlp4j-old

public MorphologicalAnalyzer(Language language)
{
  analyzer = new EnglishMorphAnalyzer();
}
edu.emory.mathcs.nlp.component.morph.englishEnglishMorphAnalyzer

Most used methods

  • <init>
    Constructs an English morphological analyzer from the dictionary in resource.
  • getAbbreviation
    Called by #analyze(DEPNode).
  • getAbbreviationMap
  • getBaseFormFromInflection
  • getDerivationalRules
    Called by #EnglishMPAnalyzer(ZipFile).
  • getInflection
  • getInflectionRules
    Called by #EnglishLemmatizer().
  • isCardinal
  • isOrdinal

Popular in Java

  • Start an intent from android
  • requestLocationUpdates (LocationManager)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • getSharedPreferences (Context)
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now