org.languagetool.dev.wikipedia
Class TextConverter
java.lang.Object
de.fau.cs.osr.ptk.common.VisitorBase<de.fau.cs.osr.ptk.common.ast.AstNode>
de.fau.cs.osr.ptk.common.AstVisitor
de.fau.cs.osr.ptk.common.Visitor
org.languagetool.dev.wikipedia.TextConverter
public class TextConverter
- extends de.fau.cs.osr.ptk.common.Visitor
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)
The methods needed to descend into an AST and visit the children of a given
node n are
dispatch(n) - visit node n,
iterate(n) - visit the children of node
n,
map(n) - visit the children of node n
and gather the return values of the visit() calls in a list,
mapInPlace(n) - visit the children of node
n and replace each child node c with the return
value of the call to visit(c).
| Nested classes/interfaces inherited from class de.fau.cs.osr.ptk.common.VisitorBase |
de.fau.cs.osr.ptk.common.VisitorBase.Target |
|
Constructor Summary |
TextConverter(org.sweble.wikitext.engine.utils.SimpleWikiConfiguration config,
int wrapCol)
|
|
Method Summary |
protected Object |
after(de.fau.cs.osr.ptk.common.ast.AstNode node,
Object result)
|
protected boolean |
before(de.fau.cs.osr.ptk.common.ast.AstNode node)
|
void |
visit(de.fau.cs.osr.ptk.common.ast.AstNode n)
|
void |
visit(org.sweble.wikitext.lazy.parser.Bold b)
|
void |
visit(org.sweble.wikitext.lazy.parser.Enumeration e)
|
void |
visit(org.sweble.wikitext.lazy.parser.EnumerationItem item)
|
void |
visit(org.sweble.wikitext.lazy.parser.ExternalLink link)
|
void |
visit(org.sweble.wikitext.lazy.parser.HorizontalRule hr)
|
void |
visit(org.sweble.wikitext.lazy.encval.IllegalCodePoint n)
|
void |
visit(org.sweble.wikitext.lazy.parser.ImageLink n)
|
void |
visit(org.sweble.wikitext.lazy.parser.InternalLink link)
|
void |
visit(org.sweble.wikitext.lazy.parser.Italics i)
|
void |
visit(org.sweble.wikitext.lazy.parser.Itemization e)
|
void |
visit(org.sweble.wikitext.lazy.parser.ItemizationItem i)
|
void |
visit(org.sweble.wikitext.lazy.parser.MagicWord n)
|
void |
visit(de.fau.cs.osr.ptk.common.ast.NodeList n)
|
void |
visit(org.sweble.wikitext.engine.Page p)
|
void |
visit(org.sweble.wikitext.lazy.parser.Paragraph p)
|
void |
visit(org.sweble.wikitext.lazy.parser.Section s)
|
void |
visit(org.sweble.wikitext.lazy.preprocessor.TagExtension n)
|
void |
visit(org.sweble.wikitext.lazy.preprocessor.Template n)
|
void |
visit(org.sweble.wikitext.lazy.preprocessor.TemplateArgument n)
|
void |
visit(org.sweble.wikitext.lazy.preprocessor.TemplateParameter n)
|
void |
visit(de.fau.cs.osr.ptk.common.ast.Text text)
|
void |
visit(org.sweble.wikitext.lazy.parser.Url url)
|
void |
visit(org.sweble.wikitext.lazy.parser.Whitespace w)
|
void |
visit(org.sweble.wikitext.lazy.utils.XmlCharRef cr)
|
void |
visit(org.sweble.wikitext.lazy.preprocessor.XmlComment n)
|
void |
visit(org.sweble.wikitext.lazy.parser.XmlElement e)
|
void |
visit(org.sweble.wikitext.lazy.utils.XmlEntityRef er)
|
| Methods inherited from class de.fau.cs.osr.ptk.common.AstVisitor |
dispatch, iterate, map, mapInPlace, mapInPlace |
| Methods inherited from class de.fau.cs.osr.ptk.common.VisitorBase |
go, resolveAndVisit, visitNotFound |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextConverter
public TextConverter(org.sweble.wikitext.engine.utils.SimpleWikiConfiguration config,
int wrapCol)
before
protected boolean before(de.fau.cs.osr.ptk.common.ast.AstNode node)
- Overrides:
before in class de.fau.cs.osr.ptk.common.VisitorBase<de.fau.cs.osr.ptk.common.ast.AstNode>
after
protected Object after(de.fau.cs.osr.ptk.common.ast.AstNode node,
Object result)
- Overrides:
after in class de.fau.cs.osr.ptk.common.VisitorBase<de.fau.cs.osr.ptk.common.ast.AstNode>
visit
public void visit(de.fau.cs.osr.ptk.common.ast.AstNode n)
visit
public void visit(de.fau.cs.osr.ptk.common.ast.NodeList n)
visit
public void visit(org.sweble.wikitext.lazy.parser.Itemization e)
visit
public void visit(org.sweble.wikitext.lazy.parser.ItemizationItem i)
visit
public void visit(org.sweble.wikitext.lazy.parser.Enumeration e)
visit
public void visit(org.sweble.wikitext.lazy.parser.EnumerationItem item)
visit
public void visit(org.sweble.wikitext.engine.Page p)
visit
public void visit(de.fau.cs.osr.ptk.common.ast.Text text)
visit
public void visit(org.sweble.wikitext.lazy.parser.Whitespace w)
visit
public void visit(org.sweble.wikitext.lazy.parser.Bold b)
visit
public void visit(org.sweble.wikitext.lazy.parser.Italics i)
visit
public void visit(org.sweble.wikitext.lazy.utils.XmlCharRef cr)
visit
public void visit(org.sweble.wikitext.lazy.utils.XmlEntityRef er)
visit
public void visit(org.sweble.wikitext.lazy.parser.Url url)
visit
public void visit(org.sweble.wikitext.lazy.parser.ExternalLink link)
visit
public void visit(org.sweble.wikitext.lazy.parser.InternalLink link)
visit
public void visit(org.sweble.wikitext.lazy.parser.Section s)
visit
public void visit(org.sweble.wikitext.lazy.parser.Paragraph p)
visit
public void visit(org.sweble.wikitext.lazy.parser.HorizontalRule hr)
visit
public void visit(org.sweble.wikitext.lazy.parser.XmlElement e)
visit
public void visit(org.sweble.wikitext.lazy.parser.ImageLink n)
visit
public void visit(org.sweble.wikitext.lazy.encval.IllegalCodePoint n)
visit
public void visit(org.sweble.wikitext.lazy.preprocessor.XmlComment n)
visit
public void visit(org.sweble.wikitext.lazy.preprocessor.Template n)
visit
public void visit(org.sweble.wikitext.lazy.preprocessor.TemplateArgument n)
visit
public void visit(org.sweble.wikitext.lazy.preprocessor.TemplateParameter n)
visit
public void visit(org.sweble.wikitext.lazy.preprocessor.TagExtension n)
visit
public void visit(org.sweble.wikitext.lazy.parser.MagicWord n)
Copyright © 2013. All Rights Reserved.