SpellCheck.java
Код: Выделить всё
package com.spell;
import org.xeustechnologies.googleapi.spelling.SpellChecker;
import org.xeustechnologies.googleapi.spelling.SpellCorrection;
import org.xeustechnologies.googleapi.spelling.SpellResponse;
public class SpellCheck {
public static void main(String[] args)
{
SpellChecker checker = new SpellChecker();
SpellResponse spellResponse = checker.check( "helloo worlrd" );
for( SpellCorrection sc : spellResponse.getCorrections() )
System.out.println( sc.getValue() );
}
}
[img]https://i.sstatic .net/lK8KF.png[/img]

< /p>
Ошибка, которую я получил после его запуск:
Исключение в потоке "main" java.lang.ExceptionInInitializerError
at com.spell.SpellCheck.main(SpellCheck .java:12)
Вызвано: java.lang.ClassCastException: org.apache.logging.slf4j.SLF4JLoggerContext невозможно привести к org.apache.logging.log4j.core.LoggerContext
в org.apache.log4j.Logger$PrivateManager.getContext(Logger.java:59)
в org.apache.log4j.Logger.getLogger(Logger .java:41)
в org.xeustechnologies.googleapi.spelling.SpellChecker.(SpellChecker.java:50)
... еще 1
Подробнее здесь: https://stackoverflow.com/questions/456 ... ext-cannot