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

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

Best Java code snippets using edu.illinois.cs.cogcomp.core.datastructures.textannotation.TextAnnotation.addAttribute (Showing top 7 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: CogComp/cogcomp-nlp

String value = doc.metadata.get(metadataKey);
if (!value.isEmpty()) {
  ta.addAttribute(metadataKey, value);
origin: edu.illinois.cs.cogcomp/illinois-corpusreaders

String value = doc.metadata.get(metadataKey);
if (!value.isEmpty()) {
  ta.addAttribute(metadataKey, value);
origin: CogComp/cogcomp-nlp

String value = doc.metadata.get(metadataKey);
if (!value.isEmpty()) {
  ta.addAttribute(metadataKey, value);
origin: edu.illinois.cs.cogcomp/stanford_3.3.1

String value = doc.metadata.get(metadataKey);
if (!value.isEmpty()) {
  ta.addAttribute(metadataKey, value);
origin: edu.illinois.cs.cogcomp/md

String value = doc.metadata.get(metadataKey);
if (!value.isEmpty()) {
  ta.addAttribute(metadataKey, value);
origin: edu.illinois.cs.cogcomp/illinois-core-utilities

public static TextAnnotation readTextAnnotation(TextAnnotationProto taImpl) throws Exception {
  String corpusId = taImpl.getCorpusId();
  String id = taImpl.getId();
  String text = taImpl.getText();
  String[] tokens = taImpl.getTokensList().toArray(new String[0]);
  Pair<Pair<String, Double>, int[]> sentences = readSentences(taImpl.getSentences());
  IntPair[] offsets = TokenUtils.getTokenOffsets(text, tokens);
  TextAnnotation ta =
      new TextAnnotation(corpusId, id, text, offsets, tokens, sentences.getSecond());
  for (ViewProto view : taImpl.getViewsList()) {
    String viewName = view.getViewName();
    List<View> topKViews = new ArrayList<>();
    for (ViewDataProto viewData : view.getViewDataList()) {
      topKViews.add(readViewData(viewData, ta));
    }
    if (viewName.equals(ViewNames.SENTENCE))
      ta.removeView(viewName);
    ta.addTopKView(viewName, topKViews);
    if (viewName.equals(ViewNames.SENTENCE))
      ta.setSentences();
  }
  for (Map.Entry<String, String> entry: taImpl.getPropertiesMap().entrySet()) {
    ta.addAttribute(entry.getKey(), entry.getValue());
  }
  return ta;
}
origin: CogComp/cogcomp-nlp

public static TextAnnotation readTextAnnotation(TextAnnotationProto taImpl) throws Exception {
  String corpusId = taImpl.getCorpusId();
  String id = taImpl.getId();
  String text = taImpl.getText();
  String[] tokens = taImpl.getTokensList().toArray(new String[0]);
  Pair<Pair<String, Double>, int[]> sentences = readSentences(taImpl.getSentences());
  IntPair[] offsets = TokenUtils.getTokenOffsets(text, tokens);
  TextAnnotation ta =
      new TextAnnotation(corpusId, id, text, offsets, tokens, sentences.getSecond());
  for (ViewProto view : taImpl.getViewsList()) {
    String viewName = view.getViewName();
    List<View> topKViews = new ArrayList<>();
    for (ViewDataProto viewData : view.getViewDataList()) {
      topKViews.add(readViewData(viewData, ta));
    }
    if (viewName.equals(ViewNames.SENTENCE))
      ta.removeView(viewName);
    ta.addTopKView(viewName, topKViews);
    if (viewName.equals(ViewNames.SENTENCE))
      ta.setSentences();
  }
  for (Map.Entry<String, String> entry: taImpl.getPropertiesMap().entrySet()) {
    ta.addAttribute(entry.getKey(), entry.getValue());
  }
  return ta;
}
edu.illinois.cs.cogcomp.core.datastructures.textannotationTextAnnotationaddAttribute

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

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