/* LanguageTool, a natural language style checker 
 * Copyright (C) 2005 Daniel Naber (http://www.danielnaber.de)
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
 * USA
 */
package org.languagetool.rules.nl;

import org.languagetool.rules.AbstractWordCoherencyRule;
import org.languagetool.rules.Example;
import org.languagetool.rules.WordCoherencyDataLoader;

import java.io.IOException;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.Set;

/**
 * Dutch version of {@link AbstractWordCoherencyRule}.
 */
public class WordCoherencyRule extends AbstractWordCoherencyRule {

  private static final Map<String, Set<String>> wordMap = new WordCoherencyDataLoader().loadWords("/nl/coherency.txt");

  public WordCoherencyRule(ResourceBundle messages) throws IOException {
    super(messages);
    addExamplePair(Example.wrong("We raden af om in één tekst zowel <marker>hivtest</marker> als <marker>hiv-test</marker> te schrijven."),
                   Example.fixed("We raden af om in één tekst zowel <marker>hivtest</marker> als <marker>hivtest</marker> te schrijven."));
  }

  @Override
  protected Map<String, Set<String>> getWordMap() {
    return wordMap;
  }

  @Override
  protected String getMessage(String word1, String word2) {
    return "Gebruik liever geen verschillende spellingen ('" + word1 + "' en '" + word2 + "') door elkaar in een tekst.";
  }

  @Override
  public String getId() {
    return "NL_WORD_COHERENCY";
  }

  @Override
  public String getDescription() {
    return "Consistente spelling van woorden met meerdere correcte vormen.";
  }

}

@@ -1562,39 +1562,41 @@
 t zowel %3Cmarker%3E
-hivtest
+caissi%C3%A8re
 %3C/marker%3E als %3Cm
@@ -1605,16 +1605,17 @@
 ker%3E
-hiv-test
+kaissi%C3%A8re
 %3C/ma
@@ -1705,39 +1705,41 @@
 t zowel %3Cmarker%3E
-hivtest
+caissi%C3%A8re
 %3C/marker%3E als %3Cm
@@ -1748,15 +1748,17 @@
 ker%3E
-hivtest
+caissi%C3%A8re
 %3C/ma

update example in rule too