Examples of XmlHighlighter


Examples of com.uwyn.jhighlight.highlighter.XmlHighlighter

     * @throws Exception
     */
    public void process(InputStream in, AbstractSAXTransformer sax, int spacesPerTab)
            throws Exception
    {
        XmlHighlighter highlighter = new XmlHighlighter();

        Reader isr = new InputStreamReader(in);

        BufferedReader r = new BufferedReader(isr);
        String line;
        String token;
        int length;
        int style;
        String css_class;
        String previous_class = null;

        int previous_style = 0;

        // Read source line by line and apply styles
        while ((line = r.readLine()) != null)
        {
            line += "\n";
            line = StringUtils.convertTabsToSpaces(line, spacesPerTab);

            Reader lineReader = new StringReader(line);

            highlighter.setReader(lineReader);

            int index = 0;
            while (index < line.length())
            {
                style = highlighter.getNextToken();
                length = highlighter.getTokenLength();
                token = line.substring(index, index + length);
               
                if (style != previous_style)
                {
                    css_class = getCssClass(style);
View Full Code Here

Examples of com.uwyn.jhighlight.highlighter.XmlHighlighter

   
    if (role.equals("JAVA")) {
        highlighter = new JavaHighlighter();
      ((JavaHighlighter) highlighter).ASSERT_IS_KEYWORD = true;     
    } else if (role.equals("XML")) {
      highlighter = new XmlHighlighter();
    } else {
      return 0;
    }
   
    Reader isr;
View Full Code Here

Examples of com.uwyn.jhighlight.highlighter.XmlHighlighter

    return null;
  }
   
  protected ExplicitStateHighlighter getHighlighter()
  {
    return new XmlHighlighter();
  }
View Full Code Here

Examples of de.tud.kom.stringmatching.gst.utils.XMLHighlighter

   
    String sourceText = docContainer.getElementAsStringFor(sourceId, DocumentContainer.MASTER);
    String derivedText = docContainer.getElementAsStringFor(derivedId, DocumentContainer.DERIVED);
 
    String text = new XMLHighlighter(new EEBOPreprocessing()).produceHighlightedText(sourceText, derivedText).trim();

    text = text.substring( text.indexOf('>') + 1, text.lastIndexOf('<') - 1);
   
    return text;
  }
View Full Code Here

Examples of de.tud.kom.stringmatching.gst.utils.XMLHighlighter

    DocumentContainer docContainer = DocumentContainer.getInstance();
    String original = docContainer.getElementAsStringFor(id, DocumentContainer.MASTER);
   
    for(TCLink link : matches){
      String match = docContainer.getElementAsStringFor(link.getCurrentDerivedId(),DocumentContainer.DERIVED);
      String highlighted = new XMLHighlighter(new EEBOPreprocessing()).produceHighlightedText(match, original);
      List<TCNote> notes = DBManager.getInstance().getNotesFor(TCNote.TYPE_PARAGRAPH, link.getCurrentDerivedId());
      List<TCNote> linkNotes = DBManager.getInstance().getNotesFor(TCNote.TYPE_LINK, link.getCurrentDerivedId());
      notes.addAll(linkNotes);
      foundMatches.add(new Match(highlighted, link, notes));
    }
View Full Code Here

Examples of de.tud.kom.stringmatching.gst.utils.XMLHighlighter

    List<TCLink> links = DBManager.getInstance().findMatchesFor(id);
   
    // set highligted text and determine, whether a proposal is already a match
    for(MatchProposal m : matches){
      // get hihglighted version of the text
      String highlighted = new XMLHighlighter(new EEBOPreprocessing()).produceHighlightedText(m.getText(), needle);
      m.setText(highlighted);
     
      //
      for(TCLink l : links)
        if(m.getId().equals(l.getCurrentDerivedId()))
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.