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;
namespace Gos.ServiceModel.Requests.Concordance
{
public abstract class BaseConcordanceSearch<TResponse> : Search<TResponse>
{
public ConcordanceSearchMainWord MainWord { get; set; }
public List<ConcordanceSearchWordInContext> WordsInContext { get; set; }
}
}
@@ -0,0 +1,9 @@
namespace Gos.ServiceModel.Requests.Concordance
{
public class ConcordanceDetails : BaseConcordanceSearch<ConcordanceDetailsResponse>
{
public int StatementId { get; set; }
public int TokenOrder { get; set; }
}
}
@@ -0,0 +1,11 @@
namespace Gos.ServiceModel.Requests.Concordance
{
public class ConcordanceDetailsResponse
{
public ConcordanceDetailsResponseStatement NextStatement { get; set; }
public ConcordanceDetailsResponseStatement PreviousStatement { get; set; }
public ConcordanceDetailsResponseStatement Statement { get; set; }
}
}
@@ -0,0 +1,39 @@
using System.Collections.Generic;
namespace Gos.ServiceModel.Requests.Concordance
{
public class ConcordanceDetailsResponseStatement
{
public string DiscourseChannel { get; set; }
public string DiscourseDescription { get; set; }
public string DiscourseEvent { get; set; }
public string DiscourseRegion { get; set; }
public string DiscourseSource { get; set; }
public string DiscourseType { get; set; }
public int Id { get; set; }
public int NumberOfSpeakers { get; set; }
public string SpeakerAge { get; set; }
public string SpeakerCode { get; set; }
public string SpeakerEducation { get; set; }
public string SpeakerLanguage { get; set; }
public string SpeakerRegion { get; set; }
public string SpeakerSex { get; set; }
public List<string> SoundFiles { get; set; }
public List<ConcordanceToken> Tokens { get; set; }
}
}
@@ -0,0 +1,11 @@
using Gos.ServiceModel.Requests.Shared;
namespace Gos.ServiceModel.Requests.Concordance
{
public class ConcordanceExport : BaseConcordanceSearch<ExportResponse>
{
public int Rows { get; set; } = 100;
public ConcordanceExportType Type { get; set; } = ConcordanceExportType.FirstRows;
}
}
@@ -0,0 +1,8 @@
namespace Gos.ServiceModel.Requests.Concordance
{
public enum ConcordanceExportType
{
FirstRows = 1,
RandomRows = 2,
}
}
@@ -0,0 +1,11 @@
using Gos.ServiceModel.Interfaces;
namespace Gos.ServiceModel.Requests.Concordance
{
public class ConcordanceSearch : BaseConcordanceSearch<ConcordanceSearchResponse>, IPagedSearch
{
public int From { get; set; } = 0;
public int Size { get; set; } = 20;
}
}
@@ -0,0 +1,6 @@
namespace Gos.ServiceModel.Requests.Concordance
{
public class ConcordanceSearchMainWord : ConcordanceSearchWord
{
}
}
@@ -0,0 +1,17 @@
using System.Collections.Generic;
using Gos.ServiceModel.Interfaces;
using Gos.ServiceModel.Types;
namespace Gos.ServiceModel.Requests.Concordance
{
public class ConcordanceSearchResponse : SearchResponse, IPagedResponse
{
public AlternateSearch<ConcordanceSearch> LemmasAlternateSearch { get; set; }
public List<ConcordanceSearchResponseItem> Items { get; set; } = new();
public int Offset { get; set; }
public long Total { get; set; }
}
}
@@ -0,0 +1,15 @@
using System.Collections.Generic;
namespace Gos.ServiceModel.Requests.Concordance
{
public class ConcordanceSearchResponseItem
{
public ConcordanceToken CenterContext { get; set; }
public List<ConcordanceToken> LeftContext { get; set; } = new();
public List<ConcordanceToken> RightContext { get; set; } = new();
public List<string> SoundFiles { get; set; }
}
}
@@ -0,0 +1,25 @@
using Gos.ServiceModel.Enums;
namespace Gos.ServiceModel.Requests.Concordance
{
public abstract class ConcordanceSearchWord
{
public string Form { get; set; }
public string ConversationalFormOverride { get; set; }
public string StandardFormOverride { get; set; }
public FormSearchType FormSearchType { get; set; }
public string Lemma { get; set; }
public string Msds { get; set; }
public ConditionType PartOfSpeechCondition { get; set; }
public int? PartOfSpeechId { get; set; }
public TranscriptionType TranscriptionType { get; set; }
}
}
@@ -0,0 +1,15 @@
using Gos.ServiceModel.Enums;
namespace Gos.ServiceModel.Requests.Concordance
{
public class ConcordanceSearchWordInContext : ConcordanceSearchWord
{
public ConditionType Condition { get; set; } = ConditionType.Is;
public DistanceType DistanceType { get; set; } = DistanceType.Distance;
public int LeftPosition { get; set; } = 3;
public int RightPosition { get; set; } = 3;
}
}
@@ -0,0 +1,27 @@
namespace Gos.ServiceModel.Requests.Concordance
{
public class ConcordanceToken
{
public string ConversationalForm { get; set; }
public bool IsCenterMatch { get; set; }
public bool IsWordInContextMatch { get; set; }
public string Lemma { get; set; }
public string Msd { get; set; }
public string MsdDescription { get; set; }
public int SegmentId { get; set; }
public string StandardForm { get; set; }
public int StatementId { get; set; }
public int StatementOrder { get; set; }
public int TokenOrder { get; set; }
}
}
@@ -0,0 +1,8 @@
using MediatR;
namespace Gos.ServiceModel.Requests.Corpus
{
public class DeleteCorpusIndex : IRequest<Unit>
{
}
}
@@ -0,0 +1,9 @@
using MediatR;
namespace Gos.ServiceModel.Requests.Corpus
{
public class ImportCorpus : IRequest<Unit>
{
public string SourcePath { get; set; }
}
}
@@ -0,0 +1,9 @@
using MediatR;
namespace Gos.ServiceModel.Requests.Corpus
{
public class ImportCounters : IRequest<Unit>
{
public string SourcePath { get; set; }
}
}
@@ -0,0 +1,9 @@
using MediatR;
namespace Gos.ServiceModel.Requests.Corpus
{
public class ImportLexicon : IRequest<Unit>
{
public string SourcePath { get; set; }
}
}
@@ -0,0 +1,8 @@
using MediatR;
namespace Gos.ServiceModel.Requests.Corpus
{
public class IndexCorpus : IRequest<Unit>
{
}
}
@@ -0,0 +1,28 @@
using System.Collections.Generic;
using Gos.ServiceModel.Enums;
namespace Gos.ServiceModel.Requests.List
{
public abstract class BaseListSearch<TResponse> : Search<TResponse>
{
protected BaseListSearch()
{
SortField = nameof(ListSearchResponseItem.Frequency);
SortDirection = SortDirection.Descending;
}
public ConditionType Condition { get; set; }
public string ConversationalForm { get; set; }
public bool GroupByMsd { get; set; }
public List<string> Lemmas { get; set; }
public string Msds { get; set; }
public List<int> PartOfSpeechIds { get; set; }
public string StandardForm { get; set; }
}
}
@@ -0,0 +1,9 @@
using Gos.ServiceModel.Requests.Shared;
namespace Gos.ServiceModel.Requests.List
{
public class ListExport : BaseListSearch<ExportResponse>
{
public int Rows { get; set; } = 100;
}
}
@@ -0,0 +1,11 @@
using Gos.ServiceModel.Interfaces;
namespace Gos.ServiceModel.Requests.List
{
public class ListSearch : BaseListSearch<ListSearchResponse>, IPagedSearch
{
public int From { get; set; } = 0;
public int Size { get; set; } = 20;
}
}
@@ -0,0 +1,14 @@
using System.Collections.Generic;
using Gos.ServiceModel.Interfaces;
namespace Gos.ServiceModel.Requests.List
{
public class ListSearchResponse : SearchResponse, IPagedResponse
{
public List<ListSearchResponseItem> Items { get; set; } = new();
public int Offset { get; set; }
public long Total { get; set; }
}
}
@@ -0,0 +1,15 @@
namespace Gos.ServiceModel.Requests.List
{
public class ListSearchResponseItem
{
public string ConversationalForm { get; set; }
public int Frequency { get; set; }
public string Msd { get; set; }
public string MsdDescription { get; set; }
public string StandardForm { get; set; }
}
}
@@ -0,0 +1,9 @@
using MediatR;
namespace Gos.ServiceModel.Requests.PartOfSpeech
{
public class GetPartOfSpeech : IRequest<GetPartOfSpeechResponse>
{
public int Id { get; set; }
}
}
@@ -0,0 +1,13 @@
using System.Collections.Generic;
namespace Gos.ServiceModel.Requests.PartOfSpeech
{
public class GetPartOfSpeechResponse
{
public List<GetPartOfSpeechResponseAttribute> Attributes = new();
public string Code { get; set; }
public string Title { get; set; }
}
}
@@ -0,0 +1,13 @@
using System.Collections.Generic;
namespace Gos.ServiceModel.Requests.PartOfSpeech
{
public class GetPartOfSpeechResponseAttribute
{
public short RecordOrder { get; set; }
public string Title { get; set; }
public List<GetPartOfSpeechResponseAttributeValue> Values { get; set; } = new();
}
}
@@ -0,0 +1,11 @@
namespace Gos.ServiceModel.Requests.PartOfSpeech
{
public class GetPartOfSpeechResponseAttributeValue
{
public string Code { get; set; }
public short RecordOrder { get; set; }
public string Title { get; set; }
}
}
+41
View File
@@ -0,0 +1,41 @@
using System.Collections.Generic;
using MediatR;
using Gos.ServiceModel.Enums;
namespace Gos.ServiceModel.Requests
{
public abstract class Search<TResponse> : Search, IRequest<TResponse>
{
}
public abstract class Search
{
public List<int> DiscourseTypeIds { get; set; } = new();
public List<int> DiscourseChannelIds { get; set; } = new();
public List<int> DiscourseEventIds { get; set; } = new();
public List<int> DiscourseRegionIds { get; set; } = new();
public List<int> DiscourseYears { get; set; } = new();
public string Query { get; set; }
public SortDirection SortDirection { get; set; }
public string SortField { get; set; }
public List<int> SpeakerAgeIds { get; set; } = new();
public List<int> SpeakerEducationIds { get; set; } = new();
public List<int> SpeakerLanguageIds { get; set; } = new();
public List<int> SpeakerRegionIds { get; set; } = new();
public List<int> SpeakerSexIds { get; set; } = new();
public TranscriptionType TranscriptionType { get; set; } = TranscriptionType.Conversational;
}
}
@@ -0,0 +1,10 @@
using System.Collections.Generic;
using Gos.ServiceModel.Types;
namespace Gos.ServiceModel.Requests
{
public class SearchResponse
{
public List<Aggregation> Aggregations { get; set; } = new();
}
}
@@ -0,0 +1,13 @@
using System.IO;
namespace Gos.ServiceModel.Requests.Shared
{
public class ExportResponse
{
public string ContentType { get; set; }
public string FileName { get; set; }
public Stream Stream { get; set; }
}
}