Package org.languagetool.tools
Class RuleMatchAsXmlSerializer
- java.lang.Object
-
- org.languagetool.tools.RuleMatchAsXmlSerializer
-
public class RuleMatchAsXmlSerializer extends java.lang.ObjectDeprecated.don't use for new use cases, the only place this should still be used is for the API mode of the command-line client (deprecated since 3.5)Generate XML to represent matching rules.- Since:
- 2.5 (as 'RuleAsXmlSerializer' up to 3.1)
-
-
Field Summary
Fields Modifier and Type Field Description private static intCAPACITYDeprecated.
-
Constructor Summary
Constructors Constructor Description RuleMatchAsXmlSerializer()Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private static java.lang.StringescapeXMLForAPIOutput(java.lang.String s)Deprecated.java.lang.StringgetXmlEnd()Deprecated.Get the string to end the XML.java.lang.StringgetXmlStart(Language lang, Language motherTongue)Deprecated.Get the string to begin the XML.private java.lang.StringgetXmlUnknownWords(java.util.List<java.lang.String> unknownWords)Deprecated.java.lang.StringruleMatchesToXml(java.util.List<RuleMatch> ruleMatches, java.lang.String text, int contextSize, Language lang)Deprecated.Get an XML representation of the given rule matches.java.lang.StringruleMatchesToXml(java.util.List<RuleMatch> ruleMatches, java.lang.String text, int contextSize, Language lang, Language motherTongue)Deprecated.Get an XML representation of the given rule matches.java.lang.StringruleMatchesToXml(java.util.List<RuleMatch> ruleMatches, java.lang.String text, int contextSize, StringTools.ApiPrintMode xmlMode, Language lang, java.util.List<java.lang.String> unknownWords)Deprecated.Get an XML representation of the given rule matches.java.lang.StringruleMatchesToXmlSnippet(java.util.List<RuleMatch> ruleMatches, java.lang.String text, int contextSize)Deprecated.Get the XML snippet (i.e.
-
-
-
Field Detail
-
CAPACITY
private static final int CAPACITY
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
getXmlStart
public java.lang.String getXmlStart(Language lang, Language motherTongue)
Deprecated.Get the string to begin the XML. After this, useruleMatchesToXmlSnippet(java.util.List<org.languagetool.rules.RuleMatch>, java.lang.String, int)and thengetXmlEnd()or better, simply useruleMatchesToXml(java.util.List<org.languagetool.rules.RuleMatch>, java.lang.String, int, org.languagetool.Language, org.languagetool.Language).
-
getXmlEnd
public java.lang.String getXmlEnd()
Deprecated.Get the string to end the XML. Use afterruleMatchesToXmlSnippet(java.util.List<org.languagetool.rules.RuleMatch>, java.lang.String, int)andgetXmlStart(org.languagetool.Language, org.languagetool.Language).
-
ruleMatchesToXmlSnippet
public java.lang.String ruleMatchesToXmlSnippet(java.util.List<RuleMatch> ruleMatches, java.lang.String text, int contextSize)
Deprecated.Get the XML snippet (i.e. not a complete XML document) for the given rules.
-
ruleMatchesToXml
public java.lang.String ruleMatchesToXml(java.util.List<RuleMatch> ruleMatches, java.lang.String text, int contextSize, Language lang, Language motherTongue)
Deprecated.Get an XML representation of the given rule matches.- Parameters:
text- the original text that was checked, used to get the context of the matchescontextSize- the desired context size in characters
-
ruleMatchesToXml
public java.lang.String ruleMatchesToXml(java.util.List<RuleMatch> ruleMatches, java.lang.String text, int contextSize, Language lang)
Deprecated.Get an XML representation of the given rule matches.- Parameters:
text- the original text that was checked, used to get the context of the matchescontextSize- the desired context size in characters
-
ruleMatchesToXml
public java.lang.String ruleMatchesToXml(java.util.List<RuleMatch> ruleMatches, java.lang.String text, int contextSize, StringTools.ApiPrintMode xmlMode, Language lang, java.util.List<java.lang.String> unknownWords)
Deprecated.Get an XML representation of the given rule matches.- Parameters:
text- the original text that was checked, used to get the context of the matchescontextSize- the desired context size in charactersunknownWords- unknown words to be printed in a separated list- Since:
- 3.0
-
getXmlUnknownWords
private java.lang.String getXmlUnknownWords(java.util.List<java.lang.String> unknownWords)
Deprecated.
-
escapeXMLForAPIOutput
private static java.lang.String escapeXMLForAPIOutput(java.lang.String s)
Deprecated.
-
-