/* JLanguageTool, 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 de.danielnaber.languagetool;

import de.danielnaber.languagetool.tagging.EnglishTagger;
import de.danielnaber.languagetool.tagging.GermanTagger;
import de.danielnaber.languagetool.tagging.Tagger;

/**
 * Constants for supported languages (currently English and German only).
 * 
 * @author Daniel Naber
 */
public class Language {

  public static final Language ENGLISH = new Language("English", "en", new EnglishTagger());
  public static final Language GERMAN = new Language("German", "de", new GermanTagger());

  private String name;
  private String shortForm;
  private Tagger tagger;

  // IMPORTANT: keep in sync with objects above
  /**
   * All languages supported by JLanguageTool.
   */
  public static final Language[] LANGUAGES = new Language[] {ENGLISH, GERMAN};

  public static Language getLanguageforShortName(String shortLanguageCode) {
    for (int i = 0; i < Language.LANGUAGES.length; i++) {
      if (shortLanguageCode.equals(Language.LANGUAGES[i].getShortName())) {
        return Language.LANGUAGES[i];
      }
    }
    return null;
  }

  public static Language getLanguageforName(String languageName) {
    for (int i = 0; i < Language.LANGUAGES.length; i++) {
      if (languageName.equals(Language.LANGUAGES[i].getName())) {
        return Language.LANGUAGES[i];
      }
    }
    return null;
  }

  private Language(String name, String shortForm, Tagger tagger) {
    this.name = name;
    this.shortForm = shortForm;
    this.tagger = tagger;
  }

  public String toString() {
    return name;
  }

  /**
   * Get this language's name, e.g. <code>English</code> or <code>German</code>.
   */
  public String getName() {
    return name;
  }

  /**
   * Get this language's two character code, e.g. <code>en</code> for English.
   */
  public String getShortName() {
    return shortForm;
  }

  /**
   * Get this language's part-of-speech tagger implemenation.
   */
  public Tagger getTagger() {
    return tagger;
  }

}

@@ -1643,16 +1643,220 @@
 RMAN%7D;%0A%0A
+  /**%0A   * Get the Language object for the given short language name.%0A   * %0A   * @param shortLanguageCode e.g. %3Ccode%3Een%3C/code%3E or %3Ccode%3Ede%3C/code%3E%0A   * @return a Language object or %3Ccode%3Enull%3C/code%3E%0A   */%0A
   public
@@ -2128,24 +2128,226 @@
  null;%0A  %7D%0A%0A
+  /**%0A   * Get the Language object for the given language name.%0A   * %0A   * @param languageName e.g. %3Ccode%3EEnglish%3C/code%3E or %3Ccode%3EGerman%3C/code%3E%0A   * @return a Language object or %3Ccode%3Enull%3C/code%3E%0A   */%0A
   public sta

add javadoc