/* LanguageTool, a natural language style checker 
 * Copyright (C) 2014 Ebrahim Byagowi <ebrahim@gnu.org>
 * 
 * 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.fa;

import java.util.HashSet;
import java.util.ResourceBundle;
import java.util.Set;

import org.languagetool.AnalyzedTokenReadings;
import org.languagetool.Language;
import org.languagetool.rules.Example;
import org.languagetool.rules.WordRepeatBeginningRule;

/**
 * List of Persian adverbs for WordRepeatBeginningRule
 * 
 * @author Ebrahim Byagowi
 */
public class PersianWordRepeatBeginningRule extends WordRepeatBeginningRule {
  
  public PersianWordRepeatBeginningRule(final ResourceBundle messages, final Language language) {
    super(messages, language);
    addExamplePair(Example.wrong("همچنین، خیابان تقریباً کاملاً مسکونی است. <marker>همچنین</marker>، به اغتخار یک شاعر نامگذاری شده‌است."),
                   Example.fixed("همچنین، خیابان تقریباً مسکونی است. <marker>این خیابان</marker> به اغتخار یک شاعر نامگذاری شده‌است."));
  }
  
  @Override
  public String getId() {
    return "PERSIAN_WORD_REPEAT_BEGINNING_RULE";
  }
  
  private static final Set<String> ADVERBS = new HashSet<>();
  static {
    ADVERBS.add("هم");
    ADVERBS.add("همچنین");
    ADVERBS.add("نیز");
    ADVERBS.add("از یک سو");
    ADVERBS.add("از یک طرف");
    ADVERBS.add("از طرف ديگر");
    ADVERBS.add("بنابراین");
    ADVERBS.add("حتی");
    ADVERBS.add("چنانچه");
  }
  
  @Override
  protected boolean isAdverb(final AnalyzedTokenReadings token) {
    return ADVERBS.contains(token.getToken());
  }

}

@@ -1546,25 +1546,25 @@
 arker%3E%D8%8C %D8%A8%D9%87 %D8%A7
-%D8%BA
+%D9%81
 %D8%AA%D8%AE%D8%A7%D8%B1 %DB%8C%DA%A9 %D8%B4%D8%A7%D8%B9%D8%B1
@@ -1690,9 +1690,9 @@
 %D8%A8%D9%87 %D8%A7
-%D8%BA
+%D9%81
 %D8%AA%D8%AE%D8%A7%D8%B1

fix a typo on rule example