Codota Logo
TextAnnotation.toString
Code IndexAdd Codota to your IDE (free)

How to use
toString
method
in
edu.illinois.cs.cogcomp.core.datastructures.textannotation.TextAnnotation

Best Java code snippets using edu.illinois.cs.cogcomp.core.datastructures.textannotation.TextAnnotation.toString (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: edu.illinois.cs.cogcomp/illinois-edison

public static void main(String[] args) throws EdisonException, AnnotatorException {
  gazetteersInstance.ignoreGazetteer("Weapons.gz");
  gazetteersInstance.ignoreGazetteer("Weapons.Missile.gz");
  List<String[]> sentences =
      Arrays.asList("I live in Chicago , Illinois .".split("\\s+"),
          "I met George Bush .".split("\\s+"));
  TextAnnotation ta = BasicTextAnnotationBuilder.createTextAnnotationFromTokens(sentences);
  gazetteersInstance.addView(ta);
  System.out.println(ta.toString());
  System.out.println(ta.getView(gazetteersInstance.getViewName()).toString());
}
origin: CogComp/cogcomp-nlp

public static void main(String[] args) throws EdisonException, AnnotatorException {
  gazetteersInstance.ignoreGazetteer("Weapons.gz");
  gazetteersInstance.ignoreGazetteer("Weapons.Missile.gz");
  List<String[]> sentences =
      Arrays.asList("I live in Chicago , Illinois .".split("\\s+"),
          "I met George Bush .".split("\\s+"));
  TextAnnotation ta = BasicTextAnnotationBuilder.createTextAnnotationFromTokens(sentences);
  gazetteersInstance.addView(ta);
  System.out.println(ta.toString());
  System.out.println(ta.getView(gazetteersInstance.getViewName()).toString());
}
origin: edu.illinois.cs.cogcomp/illinois-nlp-pipeline

TextAnnotation ta = rp.RunPipelineOnFile(inFileName);
SerializationHelper.serializeTextAnnotationToFile(ta, outFileName, true, true);
System.out.println("Processed file.  TextAnnotation.toString(): " + ta.toString());
origin: CogComp/cogcomp-nlp

TextAnnotation ta = rp.RunPipelineOnFile(inFileName);
SerializationHelper.serializeTextAnnotationToFile(ta, outFileName, true, true);
System.out.println("Processed file.  TextAnnotation.toString(): " + ta.toString());
origin: CogComp/cogcomp-nlp

protected void addDependencyTree(Tree<Pair<String, Integer>> depTree, int sentStart,
    Constituent parent) {
  String word = depTree.getLabel().getFirst();
  String token = this.getTextAnnotation().getToken(parent.getStartSpan());
  word = treebankTokenHacks(word);
  token = treebankTokenHacks(token);
  assert word.trim().length() > 0;
  assert token.trim().length() > 0;
  if (!word.equals(token)) {
    logger.error(parent.getTextAnnotation().toString());
    logger.error(depTree.toString());
    throw new IllegalStateException("Expecting " + token + ", found " + word
        + " instead while constructing the dependency tree");
  }
  for (int i = 0; i < depTree.getNumberOfChildren(); i++) {
    String relationLabel = depTree.getEdgeLabel(i).getFirst();
    Tree<Pair<String, Integer>> child = depTree.getChild(i);
    Constituent childConstituent =
        getConstituentRelativeToSentenceStart(child, 1.0, sentStart, relationLabel);
    this.addConstituent(childConstituent, true);
    this.addRelation(new Relation(relationLabel, parent, childConstituent, 1.0));
    addDependencyTree(child, sentStart, childConstituent);
  }
}
origin: CogComp/cogcomp-nlp

protected void addDependencyTreeWithHack(Tree<Pair<String, Integer>> depTree,
    Constituent parent, int sentenceStart) {
  String word = depTree.getLabel().getFirst();
  String token = this.getTextAnnotation().getToken(parent.getStartSpan());
  word = treebankTokenHacks(word);
  token = treebankTokenHacks(token);
  assert word.trim().length() > 0;
  assert token.trim().length() > 0;
  if (!word.equals(token)) {
    logger.info(parent.getTextAnnotation().toString());
    logger.info(depTree.toString());
    throw new IllegalStateException("Expecting " + token + ", found " + word
        + " instead while constructing the dependency tree");
  }
  for (int i = 0; i < depTree.getNumberOfChildren(); i++) {
    String relationLabel = depTree.getEdgeLabel(i).getFirst();
    Tree<Pair<String, Integer>> child = depTree.getChild(i);
    Constituent childConstituent =
        getConstituentRelativeToSentenceStart(child, 1.0, sentenceStart, relationLabel);
    this.addConstituent(childConstituent, true);
    this.addRelation(new Relation(relationLabel, parent, childConstituent, 1.0));
    addDependencyTreeWithHack(child, childConstituent, sentenceStart);
  }
}
origin: edu.illinois.cs.cogcomp/illinois-core-utilities

protected void addDependencyTreeWithHack(Tree<Pair<String, Integer>> depTree,
    Constituent parent, int sentenceStart) {
  String word = depTree.getLabel().getFirst();
  String token = this.getTextAnnotation().getToken(parent.getStartSpan());
  word = treebankTokenHacks(word);
  token = treebankTokenHacks(token);
  assert word.trim().length() > 0;
  assert token.trim().length() > 0;
  if (!word.equals(token)) {
    logger.info(parent.getTextAnnotation().toString());
    logger.info(depTree.toString());
    throw new IllegalStateException("Expecting " + token + ", found " + word
        + " instead while constructing the dependency tree");
  }
  for (int i = 0; i < depTree.getNumberOfChildren(); i++) {
    String relationLabel = depTree.getEdgeLabel(i).getFirst();
    Tree<Pair<String, Integer>> child = depTree.getChild(i);
    Constituent childConstituent =
        getConstituentRelativeToSentenceStart(child, 1.0, sentenceStart, relationLabel);
    this.addConstituent(childConstituent);
    this.addRelation(new Relation(relationLabel, parent, childConstituent, 1.0));
    addDependencyTreeWithHack(child, childConstituent, sentenceStart);
  }
}
origin: edu.illinois.cs.cogcomp/illinois-core-utilities

protected void addDependencyTree(Tree<Pair<String, Integer>> depTree, int sentStart,
    Constituent parent) {
  String word = depTree.getLabel().getFirst();
  String token = this.getTextAnnotation().getToken(parent.getStartSpan());
  word = treebankTokenHacks(word);
  token = treebankTokenHacks(token);
  assert word.trim().length() > 0;
  assert token.trim().length() > 0;
  if (!word.equals(token)) {
    logger.error(parent.getTextAnnotation().toString());
    logger.error(depTree.toString());
    throw new IllegalStateException("Expecting " + token + ", found " + word
        + " instead while constructing the dependency tree");
  }
  for (int i = 0; i < depTree.getNumberOfChildren(); i++) {
    String relationLabel = depTree.getEdgeLabel(i).getFirst();
    Tree<Pair<String, Integer>> child = depTree.getChild(i);
    Constituent childConstituent =
        getConstituentRelativeToSentenceStart(child, 1.0, sentStart, relationLabel);
    this.addConstituent(childConstituent);
    this.addRelation(new Relation(relationLabel, parent, childConstituent, 1.0));
    addDependencyTree(child, sentStart, childConstituent);
  }
}
edu.illinois.cs.cogcomp.core.datastructures.textannotationTextAnnotationtoString

Popular methods of TextAnnotation

  • addView
  • getView
  • hasView
  • getText
  • getId
  • getSentence
  • getTokens
  • getToken
  • getNumberOfSentences
  • size
  • getTokenIdFromCharacterOffset
    Get the position of token that corresponds to the character offset that is passed as a parameter. Th
  • getAvailableViews
  • getTokenIdFromCharacterOffset,
  • getAvailableViews,
  • <init>,
  • getSentenceId,
  • getTokenizedText,
  • getCorpusId,
  • getSentenceFromToken,
  • getTokensInSpan,
  • sentences,
  • addAttribute

Popular in Java

  • Finding current android device location
  • onRequestPermissionsResult (Fragment)
  • findViewById (Activity)
  • getContentResolver (Context)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
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