Tabnine Logo
TextReader.initialize
Code IndexAdd Tabnine to your IDE (free)

How to use
initialize
method
in
de.tudarmstadt.ukp.dkpro.core.io.text.TextReader

Best Java code snippets using de.tudarmstadt.ukp.dkpro.core.io.text.TextReader.initialize (Showing top 1 results out of 315)

origin: dkpro/dkpro-tc

@Override
public void initialize(UimaContext context) throws ResourceInitializationException
{
  super.initialize(context);
  goldLabelMap = new HashMap<String, List<String>>();
  try {
    URL resourceUrl = ResourceUtils.resolveLocation(goldLabelFile, this, context);
    for (String line : FileUtils.readLines(new File(resourceUrl.toURI()), "utf-8")) {
      String[] parts = line.split(" ");
      if (parts.length < 2) {
        throw new IOException("Wrong file format in line: " + line);
      }
      String fileId = parts[0].split("/")[1];
      List<String> labels = new ArrayList<String>();
      for (int i = 1; i < parts.length; i++) {
        labels.add(parts[i]);
      }
      goldLabelMap.put(fileId, labels);
    }
  }
  catch (IOException e) {
    throw new ResourceInitializationException(e);
  }
  catch (URISyntaxException ex) {
    throw new ResourceInitializationException(ex);
  }
}
de.tudarmstadt.ukp.dkpro.core.io.textTextReaderinitialize

Popular methods of TextReader

  • getNext
  • initCas
  • nextFile

Popular in Java

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setContentView (Activity)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now