<commit_before>/* LanguageTool, a natural language style checker 
 * Copyright (C) 2005 <NAME> (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 java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.Set;

import de.danielnaber.languagetool.language.Contributor;
import de.danielnaber.languagetool.language.Czech;
import de.danielnaber.languagetool.language.Demo;
import de.danielnaber.languagetool.language.Dutch;
import de.danielnaber.languagetool.language.English;
import de.danielnaber.languagetool.language.French;
import de.danielnaber.languagetool.language.German;
import de.danielnaber.languagetool.language.Italian;
import de.danielnaber.languagetool.language.Lithuanian;
import de.danielnaber.languagetool.language.Polish;
import de.danielnaber.languagetool.language.Slovenian;
import de.danielnaber.languagetool.language.Spanish;
import de.danielnaber.languagetool.language.Swedish;
import de.danielnaber.languagetool.language.Ukrainian;
import de.danielnaber.languagetool.synthesis.Synthesizer;
import de.danielnaber.languagetool.tagging.Tagger;
import de.danielnaber.languagetool.tagging.disambiguation.Disambiguator;
import de.danielnaber.languagetool.tagging.disambiguation.xx.DemoDisambiguator;
import de.danielnaber.languagetool.tagging.xx.DemoTagger;
import de.danielnaber.languagetool.tokenizers.SentenceTokenizer;
import de.danielnaber.languagetool.tokenizers.Tokenizer;
import de.danielnaber.languagetool.tokenizers.WordTokenizer;
import de.danielnaber.languagetool.tools.StringTools;

/**
 * Base class for any supported language (English, German, etc).
 * 
 * @author <NAME>
 */
public abstract class Language {

  // NOTE: keep in sync with array below!
  public final static Language CZECH = new Czech();
  public final static Language DUTCH = new Dutch();
  public final static Language ENGLISH = new English();
  public final static Language FRENCH = new French();
  public final static Language GERMAN = new German();
  public final static Language ITALIAN = new Italian();
  public final static Language LITHUANIAN = new Lithuanian();
  public final static Language POLISH = new Polish();
  public final static Language SLOVENIAN = new Slovenian();
  public final static Language SPANISH = new Spanish();
  public final static Language SWEDISH = new Swedish();
  public final static Language UKRAINIAN = new Ukrainian();
  
  public final static Language DEMO = new Demo();
  
  private static List<Language> externalLanguages = new ArrayList<Language>();
  
  /**
   * All languages supported by LanguageTool.
   */
  public static Language[] LANGUAGES = {
    ENGLISH, GERMAN, POLISH, FRENCH, SPANISH, ITALIAN, DUTCH, LITHUANIAN, UKRAINIAN, CZECH, SLOVENIAN, SWEDISH, DEMO
    // FIXME: load dynamically from classpath
  };

  private static final Language[] BUILTIN_LANGUAGES = LANGUAGES;

  private final static Disambiguator DEMO_DISAMBIGUATOR = new DemoDisambiguator();
  private final static Tagger DEMO_TAGGER = new DemoTagger();
  private final static SentenceTokenizer SENTENCE_TOKENIZER = new SentenceTokenizer();
  private final static WordTokenizer WORD_TOKENIZER = new WordTokenizer();

  // -------------------------------------------------------------------------

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

  /**
   * Get this language's name in English, e.g. <code>English</code> or <code>German</code>.
   */
  public abstract String getName();
  
  /**
   * Get this language's Java locale.
   */
  public abstract Locale getLocale();

  /**
   * Get the name(s) of the maintainer(s) for this language or <code>null</code>.
   */
  public abstract Contributor[] getMaintainers();<commit_msg>provide an array with all languages except the demo language<commit_after>/* LanguageTool, a natural language style checker 
 * Copyright (C) 2005 <NAME> (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 java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.Set;

import de.danielnaber.languagetool.language.Contributor;
import de.danielnaber.languagetool.language.Czech;
import de.danielnaber.languagetool.language.Demo;
import de.danielnaber.languagetool.language.Dutch;
import de.danielnaber.languagetool.language.English;
import de.danielnaber.languagetool.language.French;
import de.danielnaber.languagetool.language.German;
import de.danielnaber.languagetool.language.Italian;
import de.danielnaber.languagetool.language.Lithuanian;
import de.danielnaber.languagetool.language.Polish;
import de.danielnaber.languagetool.language.Slovenian;
import de.danielnaber.languagetool.language.Spanish;
import de.danielnaber.languagetool.language.Swedish;
import de.danielnaber.languagetool.language.Ukrainian;
import de.danielnaber.languagetool.synthesis.Synthesizer;
import de.danielnaber.languagetool.tagging.Tagger;
import de.danielnaber.languagetool.tagging.disambiguation.Disambiguator;
import de.danielnaber.languagetool.tagging.disambiguation.xx.DemoDisambiguator;
import de.danielnaber.languagetool.tagging.xx.DemoTagger;
import de.danielnaber.languagetool.tokenizers.SentenceTokenizer;
import de.danielnaber.languagetool.tokenizers.Tokenizer;
import de.danielnaber.languagetool.tokenizers.WordTokenizer;
import de.danielnaber.languagetool.tools.StringTools;

/**
 * Base class for any supported language (English, German, etc).
 * 
 * @author <NAME>
 */
public abstract class Language {

  // NOTE: keep in sync with array below!
  public final static Language CZECH = new Czech();
  public final static Language DUTCH = new Dutch();
  public final static Language ENGLISH = new English();
  public final static Language FRENCH = new French();
  public final static Language GERMAN = new German();
  public final static Language ITALIAN = new Italian();
  public final static Language LITHUANIAN = new Lithuanian();
  public final static Language POLISH = new Polish();
  public final static Language SLOVENIAN = new Slovenian();
  public final static Language SPANISH = new Spanish();
  public final static Language SWEDISH = new Swedish();
  public final static Language UKRAINIAN = new Ukrainian();
  
  public final static Language DEMO = new Demo();
  
  private static List<Language> externalLanguages = new ArrayList<Language>();
  
  /**
   * All languages supported by LanguageTool.
   */
  public static Language[] LANGUAGES = {
    ENGLISH, GERMAN, POLISH, FRENCH, SPANISH, ITALIAN, DUTCH, LITHUANIAN, UKRAINIAN, CZECH, SLOVENIAN, SWEDISH, DEMO
    // FIXME: load dynamically from classpath
  };

  /**
   * All languages supported by LanguageTool, but without the demo language.
   */
  public static Language[] REAL_LANGUAGES = new Language[LANGUAGES.length-1];
  static {
    int i = 0;
    for (Language lang : LANGUAGES) {
      if (lang != DEMO) {
        REAL_LANGUAGES[i] = lang;
        i++;
      }
    }
  }

  private static final Language[] BUILTIN_LANGUAGES = LANGUAGES;

  private final static Disambiguator DEMO_DISAMBIGUATOR = new DemoDisambiguator();
  private final static Tagger DEMO_TAGGER = new DemoTagger();
  private final static SentenceTokenizer SENTENCE_TOKENIZER = new SentenceTokenizer();
  private final static WordTokenizer WORD_TOKENIZER = new WordTokenizer();

  // -------------------------------------------------------------------------

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

  /**
   * Get this language's name in English, e.g. <code>English</code> or <code>German</code>.
   */
  public abstract String getName();
  
  /**
   * Get this language's Java locale.
   */
  public abstract Locale getLocale();

  /**
   * Get the name(s) of the maintainer(s) for this language or <code>null</code>.
   */
  public abstract Contributor[] getMaintainers();
{'fraction_non_alphanumeric': 0.10308848080133556, 'fraction_numerical': 0.0037562604340567614, 'mean_word_length': 4.220588235294118, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4155312', 'n_tokens_mistral': 3002, 'n_tokens_neox': 2871, 'n_words': 878}