Package org.languagetool.rules.patterns
Class FalseFriendRuleLoader
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.languagetool.rules.patterns.FalseFriendRuleLoader
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
public class FalseFriendRuleLoader extends DefaultHandler
LoadsPatternRule
s from a false friends XML file.- Author:
- Daniel Naber
-
-
Constructor Summary
Constructors Constructor Description FalseFriendRuleLoader(String falseFriendHint, String falseFriendSugg)
FalseFriendRuleLoader(Language motherTongue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<AbstractPatternRule>
getRules(File file, Language language, Language motherTongue)
List<AbstractPatternRule>
getRules(InputStream stream, Language textLanguage, Language motherTongue)
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Method Detail
-
getRules
public final List<AbstractPatternRule> getRules(File file, Language language, Language motherTongue) throws IOException
- Parameters:
file
- XML file with false friend rules- Throws:
IOException
- Since:
- 2.3
-
getRules
public final List<AbstractPatternRule> getRules(InputStream stream, Language textLanguage, Language motherTongue) throws ParserConfigurationException, SAXException, IOException
-
-