class LTSpellAlternatives implements XSpellAlternatives {
    
    Locale locale;
    String word;
    String[] alternatives = null;
    
    LTSpellAlternatives(String word, Locale locale) {
      try {
        this.word = word;
        this.locale = locale;
        if (noLtSpeller) {
          alternatives = new String[0];
          return;
        }
        String localeStr = OfficeTools.localeToString(locale);
        if (word == null || word.trim().isEmpty() || localeStr == null || localeStr.isEmpty()) {
          alternatives = new String[0];
          return;
        }
        List<String> wrongWords = lastWrongWords.get(localeStr);
        List<String[]> suggestions = lastSuggestions.get(localeStr);
        if (wrongWords != null && suggestions != null) {
          if (wrongWords.contains(word)) {
            int num = wrongWords.indexOf(word);
            alternatives = suggestions.get(num);
            if (alternatives == null) {
              alternatives = new String[0];
            }
            return;
          }
        }
        if (word.matches(PROB_CHARS)) {
          if (DEBUG_MODE) {
            MessageHandler.printToLogFile("LtSpellChecker: LTSpellAlternatives: Problematic word found: " + (word == null ? "null" : word));
          }
          alternatives = new String[0];
          return;
        }
        if (mSpellRule != null) {
          alternatives = mSpellRule.getSpellingSuggestions(word).toArray(new String[0]);
        }
        if (hSpellRule != null) {
          alternatives = hSpellRule.getSuggestions(word).toArray(new String[0]);
        }
      } catch (Throwable t) {
        MessageHandler.showError(t);
      }
      if (alternatives == null) {
        alternatives = new String[0];
      }
    }

    @Override
    public String[] getAlternatives() {
      return alternatives;
    }

    @Override
    public short getAlternativesCount() {
      return (short) alternatives.length;
    }

    @Override
    public short getFailureType() {
      // ??? unclear
      return 0;
    }

    @Override
    public Locale getLocale() {
      if (locale == null) {
        return lastLocale;
      }
      return locale;
    }

    @Override
    public String getWord() {
      if (word == null) {
        return "";
      }
      return word;
    }
    
  }

  @Override
  public String getServiceDisplayName(Locale locale) {
    return MultiDocumentsHandler.getServiceDisplayName(locale);
  }
  
  public static Map<String, List<String>> getWrongWords() {
    return lastWrongWords;
  }
   
  public static Map<String, List<String[]>> getSuggestions() {
    return lastSuggestions;
  }
  
  public static boolean runLTSpellChecker(XComponentContext xContext) {<FILL_FUNCTION_BODY>

    Configuration confg;
    try {
      confg = new Configuration(OfficeTools.getLOConfigDir(xContext), 
          OfficeTools.CONFIG_FILE, OfficeTools.getOldConfigFile(), null, true);
      OfficeTools.setLogLevel(confg.getlogLevel());
      DEBUG_MODE = OfficeTools.DEBUG_MODE_SP;
      return confg.useLtSpellChecker();
    } catch (IOException e) {
      MessageHandler.printToLogFile("Can't read configuration: LT spell checker not used!");
    }
    return false;
  
<no_super_class>