All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.stanford.nlp.trees.international.pennchinese.ChineseSemanticHeadFinder Maven / Gradle / Ivy

Go to download

Stanford CoreNLP provides a set of natural language analysis tools which can take raw English language text input and give the base forms of words, their parts of speech, whether they are names of companies, people, etc., normalize dates, times, and numeric quantities, mark up the structure of sentences in terms of phrases and word dependencies, and indicate which noun phrases refer to the same entities. It provides the foundational building blocks for higher level text understanding applications.

There is a newer version: 4.5.7
Show newest version
package edu.stanford.nlp.trees.international.pennchinese;

import edu.stanford.nlp.trees.TreebankLanguagePack;


/**
 * Implements a 'semantic head' variant of the the HeadFinder found in Chinese Head Finder
 *
 * @author Pi-Chuan Chang
 * @author Huihsin Tseng
 */
public class ChineseSemanticHeadFinder extends ChineseHeadFinder {

  public ChineseSemanticHeadFinder() {
    this(new ChineseTreebankLanguagePack());
  }

  public ChineseSemanticHeadFinder(TreebankLanguagePack tlp) {
    super(tlp);
    ruleChanges();
  }

  /** Makes modifications of head finder rules to better fit with semantic notions of heads. */
  private void ruleChanges() {
    nonTerminalInfo.put("VP", new String[][]{{"left", "VP", "VCD", "VPT", "VV", "VCP", "VA", "VE", "VC","IP", "VSB", "VCP", "VRD", "VNV"}, leftExceptPunct});

    nonTerminalInfo.put("CP", new String[][]{{"right", "CP", "IP", "VP"}, rightExceptPunct});

    nonTerminalInfo.put("DNP", new String[][]{{"leftdis", "NP" }});

    nonTerminalInfo.put("DVP", new String[][]{{"leftdis", "VP" ,"ADVP"}});

    nonTerminalInfo.put("LST", new String[][]{{"right", "CD", "NP", "QP", "PU"}});
  }

  private static final long serialVersionUID = 2L;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy