Package org.languagetool.rules.patterns

Examples of org.languagetool.rules.patterns.FalseFriendRuleLoader


  public List<PatternRule> loadFalseFriendRules(final String filename)
      throws ParserConfigurationException, SAXException, IOException {
    if (motherTongue == null) {
      return new ArrayList<>();
    }
    final FalseFriendRuleLoader ruleLoader = new FalseFriendRuleLoader();
    return ruleLoader.getRules(this.getClass().getResourceAsStream(filename),
        language, motherTongue);
  }
View Full Code Here


  public List<PatternRule> loadFalseFriendRules(final String filename)
      throws ParserConfigurationException, SAXException, IOException {
    if (motherTongue == null) {
      return new ArrayList<>();
    }
    final FalseFriendRuleLoader ruleLoader = new FalseFriendRuleLoader();
    final InputStream is = this.getClass().getResourceAsStream(filename);
    if (is == null) {
      return ruleLoader.getRules(new File(filename), language, motherTongue);
    } else {
      return ruleLoader.getRules(is, language, motherTongue);
    }
  }
View Full Code Here

  public List<BitextPatternRule> getFalseFriendsAsBitext(
          final String filename, final Language motherTongue,
          final Language language) throws ParserConfigurationException,
          SAXException, IOException {
    final FalseFriendRuleLoader ruleLoader = new FalseFriendRuleLoader();
    final List<BitextPatternRule> bRules = new ArrayList<>();
    final List<PatternRule> rules1 = ruleLoader.getRules(JLanguageTool
            .getDataBroker().getFromRulesDirAsStream(filename),
            motherTongue, language);
    final List<PatternRule> rules2 = ruleLoader.getRules(JLanguageTool
            .getDataBroker().getFromRulesDirAsStream(filename),
            language, motherTongue);
    final HashMap<String, PatternRule> srcRules = new HashMap<>();
    for (PatternRule rule : rules1) {
      srcRules.put(rule.getId(), rule);
View Full Code Here

TOP

Related Classes of org.languagetool.rules.patterns.FalseFriendRuleLoader

Copyright © 2018 www.massapicom. 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.