Package org.languagetool.dev.conversion.cg

Examples of org.languagetool.dev.conversion.cg.CgContextualTest


          System.err.println("Can't have two parent tests in one test on line " + rule.line + "\nTry splitting it up.");
          System.exit(1);
        }
        for (int testInt : test.ors) {
          ArrayList<Token> newTokenList = copyTokenList(tokensList);
          CgContextualTest childTest = rule.test_map.get(testInt);
          if (childTest.isNormalTest()) {
            Token childTestToken = getTokenFromNormalTest(childTest);
            newTokenList.add(childTestToken);
          } else if (childTest.isLinkedTest()) {
            ArrayList<CgContextualTest> linkedTests = new ArrayList<CgContextualTest>();
            CgContextualTest curTest = childTest;
            while (curTest.next != 0) {  // while there are still more tests to link to
              linkedTests.add(curTest);
              curTest = rule.test_map.get(curTest.next);
            }  
            linkedTests.add(curTest);   // add the last linked test
           
            Token headLinkedToken = getLinkedTokens(linkedTests)// modifies the offsets for the linked tests
            newTokenList.add(headLinkedToken);
          }
         
          outerList.add(newTokenList);
        }
      } else if (test.isLinkedTest()) {
        // add all the linked tests to a list
        ArrayList<CgContextualTest> linkedTests = new ArrayList<CgContextualTest>();
        CgContextualTest curTest = test;
        while (curTest.next != 0) {  // while there are still more tests to link to
          linkedTests.add(curTest);
          curTest = rule.test_map.get(curTest.next);
        }  
        linkedTests.add(curTest);   // add the last linked test
View Full Code Here


          System.err.println("Can't have two parent tests in one test on line " + rule.line + "\nTry splitting it up.");
          System.exit(1);
        }
        for (int testInt : test.ors) {
          ArrayList<Token> newTokenList = copyTokenList(tokensList);
          CgContextualTest childTest = rule.test_map.get(testInt);
          if (childTest.isNormalTest()) {
            Token childTestToken = getTokenFromNormalTest(childTest);
            newTokenList.add(childTestToken);
          } else if (childTest.isLinkedTest()) {
            ArrayList<CgContextualTest> linkedTests = new ArrayList<>();
            CgContextualTest curTest = childTest;
            while (curTest.next != 0) {  // while there are still more tests to link to
              linkedTests.add(curTest);
              curTest = rule.test_map.get(curTest.next);
            }  
            linkedTests.add(curTest);   // add the last linked test
           
            Token headLinkedToken = getLinkedTokens(linkedTests)// modifies the offsets for the linked tests
            newTokenList.add(headLinkedToken);
          }
         
          outerList.add(newTokenList);
        }
      } else if (test.isLinkedTest()) {
        // add all the linked tests to a list
        ArrayList<CgContextualTest> linkedTests = new ArrayList<>();
        CgContextualTest curTest = test;
        while (curTest.next != 0) {  // while there are still more tests to link to
          linkedTests.add(curTest);
          curTest = rule.test_map.get(curTest.next);
        }  
        linkedTests.add(curTest);   // add the last linked test
View Full Code Here

TOP

Related Classes of org.languagetool.dev.conversion.cg.CgContextualTest

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.