Revision: 9269
http://languagetool.svn.sourceforge.net/languagetool/?rev=9269&view=rev
Author: dnaber
Date: 2013-01-30 20:25:04 +0000 (Wed, 30 Jan 2013)
Log Message:
-----------
whitespace fixes; tiny code cleanup
Modified Paths:
--------------
trunk/languagetool/languagetool-language-modules/pl/src/test/java/org/languagetool/rules/pl/SimpleReplaceRuleTest.java
Modified:
trunk/languagetool/languagetool-language-modules/pl/src/test/java/org/languagetool/rules/pl/SimpleReplaceRuleTest.java
===================================================================
---
trunk/languagetool/languagetool-language-modules/pl/src/test/java/org/languagetool/rules/pl/SimpleReplaceRuleTest.java
2013-01-30 20:20:04 UTC (rev 9268)
+++
trunk/languagetool/languagetool-language-modules/pl/src/test/java/org/languagetool/rules/pl/SimpleReplaceRuleTest.java
2013-01-30 20:25:04 UTC (rev 9269)
@@ -28,53 +28,45 @@
import java.io.IOException;
/**
- *
- * Simple tests for rules/pl/SimpleReplaceRule class
- *
* @author Ionuț Păduraru
*/
public class SimpleReplaceRuleTest extends TestCase {
- private SimpleReplaceRule rule;
- private JLanguageTool langTool;
+ private SimpleReplaceRule rule;
+ private JLanguageTool langTool;
- protected void setUp() throws Exception {
- super.setUp();
- rule = new SimpleReplaceRule(TestTools.getMessages("pl"));
- langTool = new JLanguageTool(new Polish());
- }
+ protected void setUp() throws Exception {
+ super.setUp();
+ rule = new SimpleReplaceRule(TestTools.getMessages("pl"));
+ langTool = new JLanguageTool(new Polish());
+ }
- public void testRule() throws IOException {
+ public void testRule() throws IOException {
- // correct sentences:
- assertEquals(0,
rule.match(langTool.getAnalyzedSentence("Wszystko w porządku.")).length);
+ // correct sentences:
+ assertEquals(0, rule.match(langTool.getAnalyzedSentence("Wszystko w
porządku.")).length);
- // incorrect sentences:
+ // incorrect sentences:
+ // at the beginning of a sentence (Romanian replace rule is case-sensitive)
+ checkSimpleReplaceRule("Piaty przypadek.", "Piąty");
+ // inside sentence
+ checkSimpleReplaceRule("To piaty przypadek.", "piąty");
+ }
- // at the beginning of a sentence (Romanian replace rule is
case-sensitive)
- checkSimpleReplaceRule("Piaty przypadek.", "Piąty");
- // inside sentence
- checkSimpleReplaceRule("To piaty przypadek.", "piąty");
- }
-
- /**
- * Check if a specific replace rule applies.
- *
- * @param sentence
- * the sentence containing the incorrect/misspeled word.
- * @param word
- * the word that is correct (the suggested replacement).
- * @throws IOException
- */
- private void checkSimpleReplaceRule(String sentence, String word)
- throws IOException {
- RuleMatch[] matches;
- matches = rule.match(langTool.getAnalyzedSentence(sentence));
- assertEquals("Invalid matches.length while checking sentence: "
- + sentence, 1, matches.length);
- assertEquals("Invalid replacement count wile checking sentence:
"
- + sentence, 1,
matches[0].getSuggestedReplacements().size());
- assertEquals("Invalid suggested replacement while checking
sentence: "
- + sentence, word,
matches[0].getSuggestedReplacements().get(0));
- }
+ /**
+ * Check if a specific replace rule applies.
+ *
+ * @param sentence the sentence containing the incorrect/misspelled word.
+ * @param word the word that is correct (the suggested replacement).
+ * @throws IOException
+ */
+ private void checkSimpleReplaceRule(String sentence, String word) throws
IOException {
+ final RuleMatch[] matches =
rule.match(langTool.getAnalyzedSentence(sentence));
+ assertEquals("Invalid matches.length while checking sentence: "
+ + sentence, 1, matches.length);
+ assertEquals("Invalid replacement count wile checking sentence: "
+ + sentence, 1, matches[0].getSuggestedReplacements().size());
+ assertEquals("Invalid suggested replacement while checking sentence: "
+ + sentence, word, matches[0].getSuggestedReplacements().get(0));
+ }
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
Languagetool-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-commits