Package org.languagetool.dev.conversion

Examples of org.languagetool.dev.conversion.RuleConverter


    }
  }

  // the main workhorse
  private void convertRuleFile() {
    RuleConverter rc = getCurrentRuleConverter();
    this.rulesBox.removeAllItems();
    try {
      // the generic rule objects, just used for building the other lists
      rc.parseRuleFile();
      ruleObjects = rc.getRules();
      // lists of strings
      allRulesList = rc.getAllLtRules();
      // rules in LT format, as strings
      ruleStrings = new ArrayList<String>();
      // original rule strings
      originalRuleStrings = rc.getOriginalRuleStrings();
      // warnings
      warnings = rc.getWarnings();
      // populating the string lists
      for (int i = 0; i < allRulesList.size(); i++) {
        List<String> ruleList = allRulesList.get(i);
        String ruleString = RuleConverter
            .getRuleStringFromList(ruleList);
        ruleStrings.add(ruleString);
      }
      // take out exact copies of rules (this messes up navigating through
      // the rules with the arrow keys)
      removeDuplicateRules();

      disambigRuleIndices = new boolean[allRulesList.size()];
      // list of existing LT rules that cover the new rules
      coveredByList = new ArrayList<String[]>();
      numberOfRules = allRulesList.size();
      numRulesPane.setText(Integer.toString(numberOfRules));

      for (int i = 0; i < ruleObjects.size(); i++) {
        Object ruleObject = ruleObjects.get(i);
        if (rc.isDisambiguationRule(ruleObject)) {
          disambigRuleIndices[i] = true;
        } else {
          disambigRuleIndices[i] = false;
        }
        coveredByList.add(new String[0]);
View Full Code Here


  }

  // Methods to get properties of the gui object

  private RuleConverter getCurrentRuleConverter() {
    RuleConverter rc = null;
    String type = (String) ruleTypeBox.getSelectedItem();
    String specificType = (String) specificRuleTypeBox.getSelectedItem();
    if (specificType == null) {
      specificType = "default";
    }
View Full Code Here

    }
  }

  // the main workhorse
  private void convertRuleFile() {
    RuleConverter rc = getCurrentRuleConverter();
    this.rulesBox.removeAllItems();
    try {
      // the generic rule objects, just used for building the other lists
      rc.parseRuleFile();
      ruleObjects = rc.getRules();
      // lists of strings
      allRulesList = rc.getAllLtRules();
      // rules in LT format, as strings
      ruleStrings = new ArrayList<String>();
      // original rule strings
      originalRuleStrings = rc.getOriginalRuleStrings();
      // warnings
      warnings = rc.getWarnings();
      // populating the string lists
      for (int i = 0; i < allRulesList.size(); i++) {
        List<String> ruleList = allRulesList.get(i);
        String ruleString = RuleConverter
            .getRuleStringFromList(ruleList);
        ruleStrings.add(ruleString);
      }
      // take out exact copies of rules (this messes up navigating through
      // the rules with the arrow keys)
      removeDuplicateRules();

      disambigRuleIndices = new boolean[allRulesList.size()];
      // list of existing LT rules that cover the new rules
      coveredByList = new ArrayList<String[]>();
      numberOfRules = allRulesList.size();
      numRulesPane.setText(Integer.toString(numberOfRules));

      for (int i = 0; i < ruleObjects.size(); i++) {
        Object ruleObject = ruleObjects.get(i);
        if (rc.isDisambiguationRule(ruleObject)) {
          disambigRuleIndices[i] = true;
        } else {
          disambigRuleIndices[i] = false;
        }
        coveredByList.add(new String[0]);
View Full Code Here

  }

  // Methods to get properties of the gui object

  private RuleConverter getCurrentRuleConverter() {
    RuleConverter rc = null;
    String type = (String) ruleTypeBox.getSelectedItem();
    String specificType = (String) specificRuleTypeBox.getSelectedItem();
    if (specificType == null) {
      specificType = "default";
    }
View Full Code Here

TOP

Related Classes of org.languagetool.dev.conversion.RuleConverter

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.