You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zero/ZeroLevel/Services/Semantic/LexProviderFactory.cs

85 lines
2.3 KiB

6 years ago
using Iveonik.Stemmers;
namespace ZeroLevel.Services.Semantic
{
public static class LexProviderFactory
{
public static ILexProvider CreateProvider(ILexer lexer)
{
return new LexProvider(lexer);
}
public static ILexProvider CreateSimpleTextProvider()
{
return CreateProvider(new WordLexer());
}
public static ILexProvider CreateStemProvider(Languages language)
{
7 months ago
ILexer lexer = null!;
6 years ago
switch (language)
{
case Languages.Czech:
lexer = new CzechStemmer();
break;
6 years ago
case Languages.Danish:
lexer = new DanishStemmer();
break;
6 years ago
case Languages.Dutch:
lexer = new DutchStemmer();
break;
6 years ago
case Languages.English:
lexer = new EnglishStemmer();
break;
6 years ago
case Languages.Finnish:
lexer = new FinnishStemmer();
break;
6 years ago
case Languages.French:
lexer = new FrenchStemmer();
break;
6 years ago
case Languages.German:
lexer = new GermanStemmer();
break;
6 years ago
case Languages.Hungarian:
lexer = new HungarianStemmer();
break;
6 years ago
case Languages.Italian:
lexer = new ItalianStemmer();
break;
6 years ago
case Languages.Norwegian:
lexer = new NorwegianStemmer();
break;
6 years ago
case Languages.Portugal:
lexer = new PortugalStemmer();
break;
6 years ago
case Languages.Romanian:
lexer = new RomanianStemmer();
break;
6 years ago
case Languages.Spanish:
lexer = new SpanishStemmer();
break;
6 years ago
case Languages.Russian:
lexer = new RussianStemmer();
break;
6 years ago
default:
lexer = new RussianStemmer();
break;
}
return new LexProvider(lexer);
}
}
}

Powered by TurnKey Linux.