Package org.languagetool.dev.wikipedia
Class TextConverter
java.lang.Object
de.fau.cs.osr.utils.visitor.VisitorInterface<T>
de.fau.cs.osr.utils.visitor.VisitorBase<T>
de.fau.cs.osr.ptk.common.AstVisitor
org.languagetool.dev.wikipedia.TextConverter
public class TextConverter
extends de.fau.cs.osr.ptk.common.AstVisitor
A visitor to convert an article AST into a pure text representation. To
better understand the visitor pattern as implemented by the Visitor class,
please take a look at the following resources:
- http://en.wikipedia.org/wiki/Visitor_pattern (classic pattern)
- http://www.javaworld.com/javaworld/javatips/jw-javatip98.html (the version we use here)
n are
dispatch(n)- visit noden,iterate(n)- visit the children of noden,map(n)- visit the children of nodenand gather the return values of thevisit()calls in a list,mapInPlace(n)- visit the children of nodenand replace each child nodecwith the return value of the call tovisit(c).
-
Field Summary
Fields inherited from class de.fau.cs.osr.ptk.common.AstVisitor
REMOVE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidenableMapping(boolean enableMapping) Return a mapping from converted text positions to original text positions.Methods inherited from class de.fau.cs.osr.ptk.common.AstVisitor
dispatch, iterate, map, mapInPlaceMethods inherited from class de.fau.cs.osr.utils.visitor.VisitorBase
after, before, go, handleVisitingException, resolveAndVisit, visitNotFound
-
Constructor Details
-
TextConverter
public TextConverter()
-
-
Method Details
-
enableMapping
public void enableMapping(boolean enableMapping) -
getMapping
Return a mapping from converted text positions to original text positions.
-