This commit is contained in:
@@ -31,30 +31,32 @@ namespace AyaNova.Biz
|
||||
internal static async Task<TranslationWordBreakingData> GetTranslationSearchDataAsync(long translationId)
|
||||
{
|
||||
TranslationWordBreakingData LSD = new TranslationWordBreakingData();
|
||||
AyContext ct = ServiceProviderProvider.DBContext;
|
||||
//Get stopwords
|
||||
//Validate translation id, if not right then use default instead
|
||||
var Param = new List<string>();
|
||||
translationId = await TranslationBiz.ReturnSpecifiedTranslationIdIfExistsOrDefaultTranslationId(translationId, ct);
|
||||
Param.Add("StopWords1");
|
||||
Param.Add("StopWords2");
|
||||
Param.Add("StopWords3");
|
||||
Param.Add("StopWords4");
|
||||
Param.Add("StopWords5");
|
||||
Param.Add("StopWords6");
|
||||
Param.Add("StopWords7");
|
||||
var Stops = await TranslationBiz.GetSubsetStaticAsync(Param, translationId);
|
||||
|
||||
foreach (KeyValuePair<string, string> kvp in Stops)
|
||||
using (AyContext ct = ServiceProviderProvider.DBContext)
|
||||
{
|
||||
//Each stopwords translation key is a space delimited list of words and in the case of an empty local string (i.e. StopWords7) it's value is a single question mark
|
||||
if (kvp.Value != "?")
|
||||
{
|
||||
LSD.StopWords.AddRange(kvp.Value.Split(" "));
|
||||
}
|
||||
}
|
||||
//Get stopwords
|
||||
//Validate translation id, if not right then use default instead
|
||||
var Param = new List<string>();
|
||||
translationId = await TranslationBiz.ReturnSpecifiedTranslationIdIfExistsOrDefaultTranslationId(translationId, ct);
|
||||
Param.Add("StopWords1");
|
||||
Param.Add("StopWords2");
|
||||
Param.Add("StopWords3");
|
||||
Param.Add("StopWords4");
|
||||
Param.Add("StopWords5");
|
||||
Param.Add("StopWords6");
|
||||
Param.Add("StopWords7");
|
||||
var Stops = await TranslationBiz.GetSubsetStaticAsync(Param, translationId);
|
||||
|
||||
LSD.CJKIndex = await TranslationBiz.GetCJKIndexAsync(translationId, ct);
|
||||
foreach (KeyValuePair<string, string> kvp in Stops)
|
||||
{
|
||||
//Each stopwords translation key is a space delimited list of words and in the case of an empty local string (i.e. StopWords7) it's value is a single question mark
|
||||
if (kvp.Value != "?")
|
||||
{
|
||||
LSD.StopWords.AddRange(kvp.Value.Split(" "));
|
||||
}
|
||||
}
|
||||
|
||||
LSD.CJKIndex = await TranslationBiz.GetCJKIndexAsync(translationId, ct);
|
||||
}
|
||||
return LSD;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user