public static bool Train(string text, string className, string classifierName)
{
//var exludedWord = new List<string>() { "מסעדה", "מסעדת", "כשר", "כשר למהדרין" };
if (text != null && text != "" && className != null && className != "" && classifierName != null && classifierName != "")
{
log.InfoFormat("[Train] text={0}, className={1}, classifierName={2}.", text, className, classifierName);
string textFiltered = StringUtilities.ExcludeCommonWords(text);
var uclassifayWrite = new uClassify.WriteCalls();
var xmlRequest = XmlBuilder.BuildTrainXML(textFiltered.ToLowerInvariant(), className, classifierName);
if (uclassifayWrite.Train(xmlRequest))
{
log.InfoFormat("[Train] Success train. text={0}, className={1}, classifierName={2}.", text, className, classifierName);
return true;
}
else
{
log.WarnFormat("[Train] Unsuccess train. text={0}, className={1}, classifierName={2}.", text, className, classifierName);
}
}
else
{
log.ErrorFormat("[Train] Input properties not vailid.");
}
return false;
}