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

edu.isi.nlp.parsing.HeadFinders Maven / Gradle / Ivy

There is a newer version: 8.3.0
Show newest version
package edu.isi.nlp.parsing;

import com.google.common.annotations.Beta;
import edu.isi.nlp.ConstituentNode;
import java.io.IOException;

/** Class to get pre-made head finders for common tree formats and languages. */
@Beta
public final class HeadFinders {

  private HeadFinders() {
    throw new UnsupportedOperationException();
  }

  /**
   * Gets a head finder for English parses in Penn Treebank format using the standard Collins rules.
   */
  public static >
      HeadFinder getEnglishPTBHeadFinder() throws IOException {
    return EnglishAndChineseHeadRules.createEnglishPTBFromResources();
  }

  /**
   * Gets a head finder for Chinese parses in Penn Treebank format using rules from Honglin Sun and
   * Daniel Jurafsky. 2004. Shallow Semantic Parsing of Chinese.
   */
  public static >
      HeadFinder getChinesePTBHeadFinder() throws IOException {
    return EnglishAndChineseHeadRules.createChinesePTBFromResources();
  }

  /**
   * Gets a head finder for Spanish parses in ANCORA format. Borrows heavily from OpenNLP's Spanish
   * head finder.
   */
  public static >
      HeadFinder getSpanishAncoraHeadFinder() throws IOException {
    return SpanishHeadRules.createFromResources();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy