org.gcube.indexmanagement.common.linguistics.languageidplugin
Class DummyLangidPlugin

java.lang.Object
  extended by org.gcube.indexmanagement.common.linguistics.languageidplugin.DummyLangidPlugin
All Implemented Interfaces:
LanguageIdPlugin

public class DummyLangidPlugin
extends Object
implements LanguageIdPlugin

The dummy class for lanugae identification. This class does not recognize any language.


Field Summary
 
Fields inherited from interface org.gcube.indexmanagement.common.linguistics.languageidplugin.LanguageIdPlugin
LANG_UNKNOWN
 
Constructor Summary
DummyLangidPlugin()
          Empty constructor.
 
Method Summary
 String detectLanguage(String document)
          Detects the language in the document
 String detectLanguageFull(String document)
          Detects the language in the document and returns the full string of from detection algorithm.
 void init(String configFile)
          Method that initialises the implementation of the language id
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummyLangidPlugin

public DummyLangidPlugin()
Empty constructor.

Method Detail

init

public void init(String configFile)
          throws IndexException
Method that initialises the implementation of the language id

Specified by:
init in interface LanguageIdPlugin
Parameters:
configFile - The config file needed by the identify language
Throws:
IndexException - when the language_identifier can not be created

detectLanguage

public String detectLanguage(String document)
                      throws IndexException
Detects the language in the document

Specified by:
detectLanguage in interface LanguageIdPlugin
Parameters:
document - The document
Returns:
The ISO string of the language. The ISO string can be converted by the language class to the "ISO enum" The string "nolang" is returned if no language can be identified. The string "not_enough_data" is returned if the document string is too short.
Throws:
IndexException - in case of a failure.

detectLanguageFull

public String detectLanguageFull(String document)
                          throws IndexException
Detects the language in the document and returns the full string of from detection algorithm.

Parameters:
document - The document
Returns:
The ISO string of the language. nolang is always returned.
Throws:
IndexException - in case of a failure.


Copyright © 2012. All Rights Reserved.