|
@@ -226,8 +226,8 @@ namespace HyperCube.Pages
|
|
|
continue;
|
|
|
// получилось, выводим в нормализованном виде
|
|
|
//System.Console.Write($"[{npt.GetSourceText()}=>{npt.GetNormalCaseText(null, Pullenti.Morph.MorphNumber.Singular, Pullenti.Morph.MorphGender.Undefined, false)}] ");
|
|
|
- _report.NounGroups += $"[{npt.GetSourceText()}=>{npt.GetNormalCaseText(null, Pullenti.Morph.MorphNumber.Singular, Pullenti.Morph.MorphGender.Undefined, false)}] ";
|
|
|
-
|
|
|
+ //_report.NounGroups += $"[{npt.GetSourceText()}=>{npt.GetNormalCaseText(null, Pullenti.Morph.MorphNumber.Singular, Pullenti.Morph.MorphGender.Undefined, false)}] ";
|
|
|
+ _article.NounGroups += $"[{npt.GetSourceText()}=>{npt.GetNormalCaseText(null, Pullenti.Morph.MorphNumber.Singular, Pullenti.Morph.MorphGender.Undefined, false)}] ";
|
|
|
npt_tokens.Add(npt.GetNormalCaseText(null, Pullenti.Morph.MorphNumber.Singular, Pullenti.Morph.MorphGender.Undefined, false));
|
|
|
|
|
|
// указатель на последний токен именной группы
|
|
@@ -242,11 +242,13 @@ namespace HyperCube.Pages
|
|
|
foreach (Pullenti.Ner.Referent en in ar.Entities)
|
|
|
{
|
|
|
//Console.WriteLine($"{en.TypeName}: {en}");
|
|
|
- _report.Entities += $"{en.TypeName}: {en}\r\n";
|
|
|
+ //_report.Entities += $"{en.TypeName}: {en}\r\n";
|
|
|
+ _article.Entities += $"{en.TypeName}: {en}\r\n";
|
|
|
foreach (Pullenti.Ner.Slot s in en.Slots)
|
|
|
{
|
|
|
//Console.WriteLine($" {s.TypeName}: {s.Value}");
|
|
|
- _report.Entities += $" {s.TypeName}: {s.Value}<br>";
|
|
|
+ //_report.Entities += $" {s.TypeName}: {s.Value}<br>";
|
|
|
+ _article.Entities += $" {s.TypeName}: {s.Value}<br>";
|
|
|
}
|
|
|
}
|
|
|
// пример выделения именных групп
|
|
@@ -262,7 +264,8 @@ namespace HyperCube.Pages
|
|
|
if (npt == null)
|
|
|
continue;
|
|
|
//Console.WriteLine(npt.ToString());
|
|
|
- _report.EntitiesNounGroups += $"{npt}<br>";
|
|
|
+ //_report.EntitiesNounGroups += $"{npt}<br>";
|
|
|
+ _article.Morph += $"{npt}<br>";
|
|
|
// указатель перемещаем на последний токен группы
|
|
|
t = npt.EndToken;
|
|
|
}
|
|
@@ -275,7 +278,8 @@ namespace HyperCube.Pages
|
|
|
{
|
|
|
if (en is Pullenti.Ner.Keyword.KeywordReferent)
|
|
|
//Console.WriteLine(en.ToString());
|
|
|
- _report.Keywords1 += $"{en}<br>";
|
|
|
+ //_report.Keywords1 += $"{en}<br>";
|
|
|
+ _article.Keywords1 += $"{en}<br>";
|
|
|
}
|
|
|
//Console.WriteLine("\r\n==========================================\r\nKeywords2: ");
|
|
|
for (Pullenti.Ner.Token t = ar.FirstToken; t != null; t = t.Next)
|
|
@@ -287,7 +291,8 @@ namespace HyperCube.Pages
|
|
|
continue;
|
|
|
string kwstr = Pullenti.Ner.Core.MiscHelper.GetTextValueOfMetaToken(t as Pullenti.Ner.ReferentToken, Pullenti.Ner.Core.GetTextAttr.FirstNounGroupToNominativeSingle | Pullenti.Ner.Core.GetTextAttr.KeepRegister);
|
|
|
//Console.WriteLine($"{kwstr} = {kw}");
|
|
|
- _report.Keywords2 += $"{kwstr} = {kw}<br>";
|
|
|
+ //_report.Keywords2 += $"{kwstr} = {kw}<br>";
|
|
|
+ _article.Keywords2 += $"{kwstr} = {kw}<br>";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -309,7 +314,7 @@ namespace HyperCube.Pages
|
|
|
//Console.WriteLine($"Name: {result.Name}, Count: {result.Count}");
|
|
|
}
|
|
|
|
|
|
- AppData.Report = _report;
|
|
|
+ //AppData.Report = _report;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -378,9 +383,11 @@ namespace HyperCube.Pages
|
|
|
{
|
|
|
_modalLoading.Open();
|
|
|
|
|
|
- stringSQL = $"INSERT INTO articles (filename, article_name, authors, date_publish, annotation, keywords, file_hash) " +
|
|
|
+ stringSQL = $"INSERT INTO articles (filename, article_name, authors, date_publish, annotation, keywords, file_hash, " +
|
|
|
+ $"doc_noungroups, doc_entities, doc_morph, doc_keywords1, doc_keywords2) " +
|
|
|
$"VALUES ('{_article.Filename}', '{_article.Name}', '{_article.Authors}', '{_article.PublishDate:yyyy-MM-dd}'," +
|
|
|
- $"'{_article.Annotation}', '{_article.Keywords}', '{_article.HashSum}')";
|
|
|
+ $"'{_article.Annotation}', '{_article.Keywords}', '{_article.HashSum}'," +
|
|
|
+ $"'{_article.NounGroups}', '{_article.Entities}', '{_article.Morph}', '{_article.Keywords1}', '{_article.Keywords2}' )";
|
|
|
id = await dbCon.SQLInsert(stringSQL);
|
|
|
_article.ID = (int)id;
|
|
|
|
|
@@ -422,13 +429,13 @@ namespace HyperCube.Pages
|
|
|
{
|
|
|
MySQLConnector dbCon = MySQLConnector.Instance();
|
|
|
|
|
|
- string stringSQL = $"SELECT articles.id, filename, article_name, authors, date_publish, annotation, keywords, action_type, rating, file_hash " +
|
|
|
+ string stringSQL = $"SELECT articles.id, filename, article_name, authors, date_publish, annotation, keywords, action_type, rating, file_hash, " +
|
|
|
+ $"doc_noungroups, doc_entities, doc_morph, doc_keywords1, doc_keywords2 " +
|
|
|
$"FROM articles " +
|
|
|
$"JOIN actions_history ON actions_history.article_id = articles.id " +
|
|
|
$"WHERE articles.id={docid} " +
|
|
|
$"ORDER BY actions_history.id DESC LiMIT 1";
|
|
|
- //_articleClone = await dbCon.SQLSelectArticle(stringSQL);
|
|
|
- //_article = (ArticleModel)_articleClone.Clone();
|
|
|
+
|
|
|
AppData.CurrentArticleClone = await dbCon.SQLSelectArticle(stringSQL);
|
|
|
AppData.CurrentArticle = (ArticleModel)AppData.CurrentArticleClone.Clone();
|
|
|
|