Initial commit

This commit is contained in:
2022-07-06 21:35:05 +02:00
commit b2494052ff
97220 changed files with 2449256 additions and 0 deletions
@@ -0,0 +1,11 @@
using System.Collections.Generic;
using Gos.Core.Search.Queries;
namespace Gos.Core.Search.Aggregations
{
public interface IAggregator
{
IDictionary<string, int> Get<TQuery>(TQuery query)
where TQuery : Query;
}
}
@@ -0,0 +1,9 @@
using Gos.ServiceModel.Enums;
namespace Gos.Core.Search.Aggregations
{
public interface IAggregatorFactory
{
IAggregator GetAggregator(AggregationType aggregationType);
}
}
+22
View File
@@ -0,0 +1,22 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Gos.Core.Search.Queries;
namespace Gos.Core.Search
{
public interface ISearchEngine
{
Task Commit();
Task CreateSchema();
Task DeleteSchema();
Task Index<TEntity>(IEnumerable<TEntity> entities)
where TEntity : class;
TResult Search<TQuery, TResult>(TQuery query)
where TQuery : Query
where TResult : QueryResult;
}
}
@@ -0,0 +1,13 @@
using System.Collections.Generic;
namespace Gos.Core.Search.Queries.Concordance
{
public class ConcordanceQuery : Query
{
public ConcordanceQueryMainWord MainWord { get; set; }
public bool ReturnRandomRows { get; set; }
public List<ConcordanceQueryWordInContext> WordsInContext { get; set; }
}
}
@@ -0,0 +1,6 @@
namespace Gos.Core.Search.Queries.Concordance
{
public class ConcordanceQueryMainWord : ConcordanceQueryWord
{
}
}
@@ -0,0 +1,9 @@
using System.Collections.Generic;
namespace Gos.Core.Search.Queries.Concordance
{
public class ConcordanceQueryResult : QueryResult
{
public List<ConcordanceQueryResultItem> Items { get; set; }
}
}
@@ -0,0 +1,11 @@
namespace Gos.Core.Search.Queries.Concordance
{
public class ConcordanceQueryResultItem
{
public int DiscourseId { get; set; }
public int StatementOrder { get; set; }
public int TokenOrder { get; set; }
}
}
@@ -0,0 +1,20 @@
using System.Collections.Generic;
using Gos.ServiceModel.Enums;
namespace Gos.Core.Search.Queries.Concordance
{
public class ConcordanceQueryWord
{
public string ConversationalForm { get; set; }
public List<string> Lemmas { get; set; }
public List<string> Msds { get; set; }
public ConditionType PartOfSpeechCondition { get; set; }
public int? PartOfSpeechId { get; set; }
public string StandardForm { get; set; }
}
}
@@ -0,0 +1,15 @@
using Gos.ServiceModel.Enums;
namespace Gos.Core.Search.Queries.Concordance
{
public class ConcordanceQueryWordInContext : ConcordanceQueryWord
{
public ConditionType Condition { get; set; }
public DistanceType DistanceType { get; set; }
public int LeftPosition { get; set; }
public int RightPosition { get; set; }
}
}
@@ -0,0 +1,26 @@
using System.Collections.Generic;
using Gos.ServiceModel.Enums;
namespace Gos.Core.Search.Queries.List
{
public class ListQuery : Query
{
public ConditionType Condition { get; set; }
public string ConversationalForm { get; set; }
public string Query { get; set; }
public bool GroupByMsd { get; set; }
public List<string> Lemmas { get; set; }
public List<string> Msds { get; set; }
public List<int> PartOfSpeechIds { get; set; }
public string StandardForm { get; set; }
public TranscriptionType TranscriptionType { get; set; }
}
}
@@ -0,0 +1,9 @@
using System.Collections.Generic;
namespace Gos.Core.Search.Queries.List
{
public class ListQueryResult : QueryResult
{
public List<ListQueryResultItem> Items { get; set; }
}
}
@@ -0,0 +1,13 @@
namespace Gos.Core.Search.Queries.List
{
public class ListQueryResultItem
{
public string ConversationalForm { get; set; }
public int Frequency { get; set; }
public string Msd { get; set; }
public string StandardForm { get; set; }
}
}
+38
View File
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using Gos.Core.Extensions;
namespace Gos.Core.Search.Queries
{
public abstract class Query : ICloneable
{
public List<int> DiscourseTypeIds { get; set; }
public List<int> DiscourseChannelIds { get; set; }
public List<int> DiscourseEventIds { get; set; }
public List<int> DiscourseRegionIds { get; set; }
public List<int> DiscourseYears { get; set; }
public int From { get; set; } = 0;
public int Size { get; set; } = 20;
public List<int> SpeakerAgeIds { get; set; }
public List<int> SpeakerEducationIds { get; set; }
public List<int> SpeakerLanguageIds { get; set; }
public List<int> SpeakerRegionIds { get; set; }
public List<int> SpeakerSexIds { get; set; }
public object Clone()
{
return this.Copy();
}
}
}
@@ -0,0 +1,7 @@
namespace Gos.Core.Search.Queries
{
public abstract class QueryResult
{
public long Total { get; set; }
}
}