Package org.languagetool.rules.patterns.bitext

Examples of org.languagetool.rules.patterns.bitext.FalseFriendsAsBitextLoader


    if (is != null) {
      bRules.addAll(ruleLoader.getRules(is, name));
    }
   
    //load the false friend rules in the bitext mode:
    final FalseFriendsAsBitextLoader fRuleLoader = new FalseFriendsAsBitextLoader();
    final String falseFriendsFile = "/false-friends.xml";
    final List<BitextPatternRule> rules = fRuleLoader.getFalseFriendsAsBitext(falseFriendsFile, source, target);
    bRules.addAll(rules);

    //load Java bitext rules:
    // TODO: get ResourceBundle for possible parameters for rules
    bRules.addAll(getAllBuiltinBitextRules(source, null));
View Full Code Here


    final Polish polish = new Polish();
    final English english = new English();
    final JLanguageTool langTool = new JLanguageTool(english, polish);
    final JLanguageTool trgTool = new JLanguageTool(polish);
   
    final FalseFriendsAsBitextLoader ruleLoader = new FalseFriendsAsBitextLoader();
    final String name = "/false-friends.xml";
    final List<BitextPatternRule> rules = ruleLoader.
    getFalseFriendsAsBitext(name, english, polish);
   
    assertErrors(1, rules, "This is an absurd.", "To absurd.", langTool, trgTool);      
    assertErrors(1, rules, "I have to speak to my advocate.", "Muszę porozmawiać z adwokatem.", langTool, trgTool);   
    assertErrors(1, rules, "This is not actual.", "To nie jest aktualne.", langTool, trgTool);
View Full Code Here

    if (is != null) {
      bRules.addAll(ruleLoader.getRules(is, name));
    }
   
    //load the false friend rules in the bitext mode:
    final FalseFriendsAsBitextLoader fRuleLoader = new FalseFriendsAsBitextLoader();
    final String falseFriendsFile = "/false-friends.xml";
    final List<BitextPatternRule> rules = fRuleLoader.getFalseFriendsAsBitext(falseFriendsFile, source, target);
    bRules.addAll(rules);

    //load Java bitext rules:
    bRules.addAll(getAllBuiltinBitextRules(source, null));
    return bRules;
View Full Code Here

TOP

Related Classes of org.languagetool.rules.patterns.bitext.FalseFriendsAsBitextLoader

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.