예제 #1
0
 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;
     }
 }
예제 #2
0
 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 "";
     }
 }
예제 #3
0
 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;
     }
 }
예제 #4
0
 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);
 }
예제 #5
0
 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);
 }
예제 #6
0
 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)));
 }
예제 #7
0
파일: SentenceWord.cs 프로젝트: Ogonik/LWS
 public SentenceWord(string text, SentenceWordType type, bool isAuxilary)
 {
     IsAuxilary = isAuxilary;
     Text = text;
     Type = type;
 }
예제 #8
0
 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;
 }
예제 #9
0
 private LinguisticObjectType _getLinguisticObjectType(SentenceWordType chainType)
 {
     switch (chainType)
     {
     case SentenceWordType.Subject: return LinguisticObjectType.ChainFromSubject;
     case SentenceWordType.Predicate: return LinguisticObjectType.ChainFromPredicate;
     default: return LinguisticObjectType.ChainFromMeaningPart;
     }
 }