Examples of CoreLabel


Examples of edu.stanford.nlp.ling.CoreLabel

   * @param tokens The list of tokens representing this sentence.
   * @return The original text of the sentence.
   */
  protected String recoverOriginalText(List<CoreLabel> tokens, CoreNLPProtos.Sentence sentence) {
    StringBuilder text = new StringBuilder();
    CoreLabel last = null;
    if (tokens.size() > 0) {
      CoreLabel token = tokens.get(0);
      if (token.originalText() != null) { text.append(token.originalText()); } else { text.append(token.word()); }
      last = tokens.get(0);
    }
    for (int i = 1; i < tokens.size(); ++i) {
      CoreLabel token = tokens.get(i);
      if (token.before() != null) {
        text.append(token.before());
        assert last != null;
        int missingWhitespace = (token.beginPosition() - last.endPosition()) - token.before().length();
        while (missingWhitespace > 0) {
          text.append(' ');
          missingWhitespace -= 1;
        }
      }
      if (token.originalText() != null) { text.append(token.originalText()); } else { text.append(token.word()); }
      last = token;
    }
    return text.toString();
  }
View Full Code Here

Examples of fr.openwide.core.wicket.markup.html.basic.CoreLabel

    add(new ListView<ProjectLicense>("licenses", licensesModel) {
      private static final long serialVersionUID = 1L;

      @Override
      protected void populateItem(ListItem<ProjectLicense> item) {
        item.add(new CoreLabel("licenseShortLabel", BindingModel.of(item.getModel(), Binding.projectLicense().shortLabel()))
            .hideIfEmpty());
       
        item.add(new Label("licenseLabel", BindingModel.of(item.getModel(), Binding.projectLicense().label())));

        item.add(new HideableExternalLink("licenseLink", BindingModel.of(item.getModel(), Binding.projectLicense().licenseUrl())));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.