Examples of AnnotatedText


Examples of org.languagetool.markup.AnnotatedText

  }

  @Test
  public void testAnnotateTextCheck() throws IOException {
    JLanguageTool languageTool = new JLanguageTool(english);
    AnnotatedText annotatedText = new AnnotatedTextBuilder()
            .addMarkup("<b>")
            .addText("here")
            .addMarkup("</b>")
            .addText(" is an error")
            .build();
View Full Code Here

Examples of org.languagetool.markup.AnnotatedText

  }

  @Test
  public void testAnnotateTextCheckMultipleSentences() throws IOException {
    JLanguageTool languageTool = new JLanguageTool(english);
    AnnotatedText annotatedText = new AnnotatedTextBuilder()
            .addMarkup("<b>")
            .addText("here")
            .addMarkup("</b>")
            .addText(" is an error. And ")
            .addMarkup("<i attr='foo'>")
View Full Code Here

Examples of org.languagetool.markup.AnnotatedText

  }

  @Test
  public void testAnnotateTextCheckMultipleSentences2() throws IOException {
    JLanguageTool languageTool = new JLanguageTool(english);
    AnnotatedText annotatedText = new AnnotatedTextBuilder()
            .addText("here")
            .addText(" is an error. And ")
            .addMarkup("<i attr='foo'/>")
            .addText("here is also ")
            .addMarkup("<i>")
View Full Code Here

Examples of org.languagetool.markup.AnnotatedText

  }

  @Test
  public void testAnnotateTextCheckPlainText() throws IOException {
    JLanguageTool languageTool = new JLanguageTool(english);
    AnnotatedText annotatedText = new AnnotatedTextBuilder()
            .addText("A good sentence. But here's a error.").build();
    List<RuleMatch> matches = languageTool.check(annotatedText);
    assertThat(matches.size(), is(1));
    assertThat(matches.get(0).getFromPos(), is(28));
    assertThat(matches.get(0).getToPos(), is(29));
View Full Code Here

Examples of org.languagetool.markup.AnnotatedText

            paRes.nStartOfSentencePosition);
        paRes.nStartOfSentencePosition = position;
        paRes.nStartOfNextSentencePosition = position + sentence.length();
        paRes.nBehindEndOfSentencePosition = paRes.nStartOfNextSentencePosition;
        if (!StringTools.isEmpty(sentence)) {
          AnnotatedText annotatedText = getAnnotatedText(sentence, footnotePositions, paRes);
          final List<RuleMatch> ruleMatches = langTool.check(annotatedText, false,
              JLanguageTool.ParagraphHandling.ONLYNONPARA);
          final SingleProofreadingError[] pErrors = checkParaRules(paraText,
                  paRes.nStartOfSentencePosition,
              paRes.nStartOfNextSentencePosition, paRes.aDocumentIdentifier);
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.