Package org.languagetool.rules.km

Examples of org.languagetool.rules.km.KhmerSpaceBeforeRule


*/
public class KhmerSpaceBeforeRuleTest extends TestCase {

    public void testSpaceBeforeRule() throws IOException {
        final Khmer language = new Khmer();
        KhmerSpaceBeforeRule rule = new KhmerSpaceBeforeRule(TestTools.getEnglishMessages(), language);
        JLanguageTool langTool = new JLanguageTool(language);
        // correct sentences:
        assertEquals(0, rule.match(langTool.getAnalyzedSentence("គាត់​បាន​ទៅ ដើម្បី​ទិញ​ម្ហូប។")).length);
        assertEquals(0, rule.match(langTool.getAnalyzedSentence("ខ្ញុំ និង​គាត់។")).length);
        assertEquals(0, rule.match(langTool.getAnalyzedSentence("គាត់​ចង់​បាន ពីព្រោះ​គាត់​អត់​មាន។")).length);

        // incorrect sentences:
        assertEquals(1, rule.match(langTool.getAnalyzedSentence("គាត់​បាន​ទៅ​ដើម្បី​ទិញ​ម្ហូប។")).length);
        assertEquals(1, rule.match(langTool.getAnalyzedSentence("ខ្ញុំ​និង​គាត់។")).length);
        assertEquals(1, rule.match(langTool.getAnalyzedSentence("គាត់​ចង់​បាន​ពីព្រោះ​គាត់​អត់​មាន។")).length);
    }
View Full Code Here


      new HunspellRule(messages, this),
      // specific to Khmer:
      new KhmerSimpleReplaceRule(messages),
      new KhmerWordRepeatRule(messages, this),
      new KhmerUnpairedBracketsRule(messages, this),
      new KhmerSpaceBeforeRule(messages, this)
    );
  }
View Full Code Here

TOP

Related Classes of org.languagetool.rules.km.KhmerSpaceBeforeRule

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.