Tabnine Logo
BlueCasUtil.getTitle
Code IndexAdd Tabnine to your IDE (free)

How to use
getTitle
method
in
ch.epfl.bbp.uima.BlueCasUtil

Best Java code snippets using ch.epfl.bbp.uima.BlueCasUtil.getTitle (Showing top 3 results out of 315)

origin: ch.epfl.bbp.nlp/bluima_commons

@Override
public void process(JCas jCas) throws AnalysisEngineProcessException {
  String title = getTitle(jCas);
  String text = jCas.getDocumentText();
  // add title to text if too small
  if (text.length() < minTextLenght && title.length() > 0) {
    text = title + " " + text;
  }
  // only detect if text is long enough
  if (text != null && text.length() > minTextLenght) {
    // TODO maybe cut if text too long --> slower
    try {
      jCas.setDocumentLanguage(detect(text));
    } catch (LangDetectException e) {
      LOG.warn("error detecting language for {}, {}",
          getHeaderDocId(jCas), e);
    }
  }
}
origin: ch.epfl.bbp.nlp/bluima_text2pmid

@Override
public void process(JCas jCas) throws AnalysisEngineProcessException {
  int pmid = BlueCasUtil.getHeaderIntDocId(jCas);
  if (!BlueCasUtil.isEmptyText(jCas)) {
    // System.out.println("indexing:: " + pmid);
    Document doc = new Document();
    doc.add(new IntField(PMID_FIELD, pmid, Store.YES));
    doc.add(new TextField(CONTENT_FIELD, jCas.getDocumentText(),
        Store.YES));
    doc.add(new TextField(TITLE_FIELD, getTitle(jCas), Store.YES));
    try {
      indexWriter.addDocument(doc);
    } catch (IOException e) {
      throw new AnalysisEngineProcessException(e);
    }
  }
}
origin: ch.epfl.bbp.nlp/bluima_db

@Override
public void process(JCas jCas) throws AnalysisEngineProcessException {
  int pmId = getHeaderIntDocId(jCas);
  try {
    if (PubmedArticleEntity.findFirst(PUBMED_ID + " = ?", pmId) == null) {
      PubmedArticleEntity a = new PubmedArticleEntity();
      a.set(PUBMED_ID, pmId);
      a.set(ABSTRACT, jCas.getDocumentText());
      try {
        Date date = JCasUtil.selectSingle(jCas, Date.class);
        a.set(PUBLISHED_DATE,
            date.getYear() + "-" + date.getMonth() + "-"
                + date.getDay());
      } catch (Exception e) {// nope
        LOG.warn("could not add date to " + pmId, e);
      }
      a.set(TITLE, StringUtils.snippetizeAtSpace(getTitle(jCas), 510));
      a.saveIt();
      inserted++;
      if (processed++ % 10000 == 0)
        LOG.debug("processed {}\tinserted {}", processed, inserted);
    }
  } catch (Exception e) {
    LOG.error("could not insert " + pmId, e);
  }
}
ch.epfl.bbp.uimaBlueCasUtilgetTitle

Popular methods of BlueCasUtil

  • getHeaderIntDocId
  • getHeaderDocId
  • isEmptyText
  • distance
  • getHeaderSource
  • getSinglePosTag
  • selectCovered

Popular in Java

  • Reactive rest calls using spring rest template
  • setRequestProperty (URLConnection)
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • JTextField (javax.swing)
  • Option (scala)
  • CodeWhisperer alternatives
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