private static Dictionary<SentenceWordChain, List<LinguisticObject>> _getProperGroupCollection( SentenceWordType chainMasterType, SimpleSentenceStats stats) { switch (chainMasterType) { case SentenceWordType.Subject: return stats.ChainsFromSubjects; case SentenceWordType.Predicate: return stats.ChainsFromPredicates; default: return stats.ChainsFromMeaningParts; } }
private string _getChainHeaderLabel(SentenceWordType type, int index) { switch (type) { case SentenceWordType.Subject: return Labels.LoLableChainPrefixSubject + index; case SentenceWordType.Predicate: return Labels.LoLableChainPrefixPredicate + index; case SentenceWordType.MeaningPart: return Labels.LoLableChainPrefixMeaning + index; default: return ""; } }
private Color? _getChainHeaderColor(SentenceWordType chainType) { switch (chainType) { case SentenceWordType.Subject: return Colors.SubjectHeader; case SentenceWordType.Predicate: return Colors.PredicateHeader; case SentenceWordType.MeaningPart: return Colors.MeaningHeader; default: return null; } }
private void _addWordsAsWordChain(IEnumerable<IPPI.SentenceWord> ippiWords, ICollection<SentenceWordChain> wordsChains, SentenceWordType wordsType) { wordsChains.Add(_toWordChain(ippiWords)); wordsChains.SelectMany(chain => chain.Words).ForEach(word => word.Type = wordsType); }
private void _addWordsAsWordChain(IEnumerable<Compreno.SentenceElement> comprenoWords, List<SentenceWordChain> wordsChains, SentenceWordType wordsType) { wordsChains.Add(_toWordChain(comprenoWords)); wordsChains.SelectMany(chain => chain.Words).ForEach(word => word.Type = wordsType); }
private void _writeLinkedChainSecondHeader(Dictionary<SentenceWordChain, List<LinguisticObject>> chains, SentenceWordType type) { chains.Values.SelectMany((list, i) => list.Select(o => i)) .ForEach(i => XlHelper.WriteValue(_getChainHeaderLabel(type, i), _getChainHeaderColor(type))); }
public SentenceWord(string text, SentenceWordType type, bool isAuxilary) { IsAuxilary = isAuxilary; Text = text; Type = type; }
private static double _countAverageWordsInLo(List<LinkedChain> linkedChains, SentenceWordType type) { var typedChains = linkedChains.Where(chain => chain.Master.Words.Any(word => word.Type == type)).ToList(); return typedChains.Count != 0 ? typedChains.Aggregate(0d, (d, chain) => d + (new LinkedChainWords(chain)).Words.Count)/typedChains.Count : 0d; }
private LinguisticObjectType _getLinguisticObjectType(SentenceWordType chainType) { switch (chainType) { case SentenceWordType.Subject: return LinguisticObjectType.ChainFromSubject; case SentenceWordType.Predicate: return LinguisticObjectType.ChainFromPredicate; default: return LinguisticObjectType.ChainFromMeaningPart; } }