protected override BaseSentenceAlgorithmData InitSourceData(List<BaseSentenceAlgorithm> algorithms) { // источник данных алгоритм 1.1 и 1.2 var prevResultHlpData = new GeneralHelperData(); prevResultHlpData.Merge(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.Subject.SimpleSubject.InternalName)); prevResultHlpData.Merge(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.Subject.WhichSubject.InternalName)); var subjAlgResult = algorithms.FindByInternalName(AlgorithmNames.Subject.SimpleSubject.InternalName).AlgResult; subjAlgResult.HelperData = prevResultHlpData; return subjAlgResult; }
protected override BaseSentenceAlgorithmData InitSourceData(List<BaseSentenceAlgorithm> algorithms) { var independentInfinitiveResultHlpData = algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.Predicate.IndependentInfinitive.InternalName); var participlesResultHlpData = algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.Predicate.Participles.InternalName); var adverbialParticiplesAndPhantomsResultHlpData = algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.Predicate.AdverbialParticiplesAndPhantom.InternalName); var predicateInfos = new List<Tuple<string, PredicateType>>(); foreach (DataRow row in independentInfinitiveResultHlpData.Rows) { var predicateId = row.Field<int>(HelperDataIndependentInfinitiveTruePredicateIds.Name); if (predicateId > 0) predicateInfos.Add(new Tuple<string, PredicateType>(row.Field<string>(HelperDataColumnElementGUID.Name), PredicateType.Predicate)); } foreach (DataRow row in participlesResultHlpData.Rows) { var participleId = row.Field<int>(HelperDataParticiplesParticipleFinalId.Name); if (participleId > 0) predicateInfos.Add(new Tuple<string, PredicateType>(row.Field<string>(HelperDataColumnElementGUID.Name), PredicateType.Participle)); } foreach (DataRow row in adverbialParticiplesAndPhantomsResultHlpData.Rows) { var advParticipleId = row.Field<int>(HelperDataAdverbialParticiplesAdverbialParticipleIds.Name); var phantomId = row.Field<int>(HelperDataAdverbialParticiplesPhantomIds.Name); if (advParticipleId > 0) predicateInfos.Add(new Tuple<string, PredicateType>(row.Field<string>(HelperDataColumnElementGUID.Name), PredicateType.AdverbialParticiple)); if (phantomId > 0) predicateInfos.Add(new Tuple<string, PredicateType>(row.Field<string>(HelperDataColumnElementGUID.Name), PredicateType.Phantom)); } var result = new BaseSentenceAlgorithmData(); var resultHelpData = new PredicateUnionHelperData(Info.InternalName); var tmpAlgResult = algorithms.FindByInternalName(AlgorithmNames.Predicate.IndependentInfinitive.InternalName).AlgResult; foreach (var info in predicateInfos) resultHelpData.AddOrUpdateCustomRow(info.Item1, tmpAlgResult.Sentence.Elements.Find(x => x.GUID == info.Item1).Id, info.Item2.ToString()); result.HelperData = resultHelpData; return result; }
protected override BaseSentenceAlgorithmData InitSourceData(List<BaseSentenceAlgorithm> algorithms) { GrammaticalBasises = new GrammaticalBasises(); _fillInGOs( algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.GrammaticalBasis.GrammaticalBaseStage1.InternalName), HelperDataGrammaticalBaseStage1PredicateId.Name, HelperDataGrammaticalBaseStage1SubjectId.Name); _fillInGOs( algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.GrammaticalBasis.ParticiplePair.InternalName), HelperDataParticiplePairParticipleId.Name, HelperDataParticiplePairSubjectId.Name); _fillInGOs( algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.GrammaticalBasis.AdverbialParticiplePair.InternalName), HelperDataParticiplePairAdvParticipleId.Name, HelperDataParticiplePairAdvParticipleSubjectId.Name); return new BaseSentenceAlgorithmData(); }
protected override BaseSentenceAlgorithmData InitSourceData(List<BaseSentenceAlgorithm> algorithms) { var initedData = new BaseSentenceAlgorithmData(); var sourceResult = algorithms.FindByInternalName(AlgorithmNames.DivorcedWords.DivorcedWordsRoot.InternalName).AlgResult; initedData.HelperData = new GeneralHelperData(); var gosIds = sourceResult.HelperData.ColumnIntPositiveValues(HelperDataDivorcedWordsRootRootId.Name); var gsfData = algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.DivorcedWords.PhantomPredicateRoot.InternalName); var gsfIds = gsfData.ColumnIntPositiveValues(HelperDataPhantomPredicateRootRootId.Name); var allGOSIds = gosIds.Concat(gsfIds); foreach (var gosId in allGOSIds) initedData.HelperData.Rows.Add(Guid.NewGuid().ToString(), gosId, ""); return initedData; }
private void _addDataActionsForAddConjunction(List<BaseSentenceAlgorithm> algorithms) { // - False ParticleI _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.ParticleIParent.InternalName), new ParticleIAddConjunctionPostProcessingAction())); // добавление соч связи - ПСС и ССПСС _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.ConjunctedWordsForPSS.InternalName), new PSSAddConjunctionPostProcessingAction())); // добавление соч связи - ПЭС и ССПЭС _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.UPAdjectiveForElliptedNoun.InternalName), new PESAddConjunctionPostProcessingAction())); // добавление соч связи - Квази ОЧ приложение _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.QuasiUniformPartsAttachmentMain.InternalName), new QuasiUPAttachmentAddConjunctionPostProcessingAction())); // СПСС _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindByInternalName(AlgorithmNames.UniformParts.WordWithLostConjunction.InternalName).AlgResult.HelperDataElements.Find(x => x.TableName == WordWithLostConjunction.ResultTableName), new SPSSAddConjunctionPostProcessingAction())); }
private void _addDataActionsForModifySurfaceSlot(List<BaseSentenceAlgorithm> algorithms) { // КвазиОЧ приложение _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.QuasiUniformPartsAttachmentMain.InternalName), new QuasiUniformartsAttachmentChangeSurfaceSlotProcessingAction())); }
protected override BaseSentenceAlgorithmData InitSourceData(List<BaseSentenceAlgorithm> algorithms) { // источник данных алгоритм 5.1 -- 5.8 // структура у всех данных с 5.1 по 5.7 одинаковая, используем структуру от стандартных КСО ОЧ var prevResultHlpData = new StandartUPRowsHelperData(Info.InternalName); prevResultHlpData.Merge(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.StandartUPRows.InternalName), true, MissingSchemaAction.Ignore); prevResultHlpData.PrimaryKey = null; prevResultHlpData.Merge(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.ParticleIRows.InternalName), true, MissingSchemaAction.Ignore); // Алгоритм удален 19.09.2016 // prevResultHlpData.Merge(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformPartsFinalResults.QuasiUPRows.InternalName), true, MissingSchemaAction.Ignore); prevResultHlpData.Merge(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.SPSSRows.InternalName), true, MissingSchemaAction.Ignore); prevResultHlpData.Merge(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.QuasiUPAttachmentRows.InternalName), true, MissingSchemaAction.Ignore); prevResultHlpData.Merge(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.QuasiUPAttachmentVerbRows.InternalName), true, MissingSchemaAction.Ignore); prevResultHlpData.Merge(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.PSSRows.InternalName), true, MissingSchemaAction.Ignore); prevResultHlpData.Merge(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.AdjectiveForElliptedNounRows.InternalName), true, MissingSchemaAction.Ignore); var upAlgResult = algorithms.FindByInternalName(AlgorithmNames.UniformParts.StandartUPRows.InternalName).AlgResult; upAlgResult.HelperData = prevResultHlpData; _conjunctedLinkHelperData = (ConjunctionLinkFeatureHelperData)algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.ConjunctedLinkFeature.InternalName); _elliptedNounLinkHelperData = (ElliptedNounLinkFeatureHelperData)algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.ElliptedNounLinkFeature.InternalName); _сonjILinkHelperData = (ConjunctionILinkFeatureHelperData)algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.ConjunctionILinkFeature.InternalName); _pssLinkHelperData = (PSSLinkFeatureHelperData)algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.PSSLinkFeature.InternalName); _quasiUPAttachmentLinkFeatureHelperData = (QuasiUPAttachmentLinkFeatureHelperData)algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.QuasiUPAttachmentLinkFeature.InternalName); _quasiUPAttachmentVerbLinkFeatureHelperData = (QuasiUPAttachmentVerbLinkFeatureHelperData)algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.QuasiUPAttachmentVerbLinkFeature.InternalName); return upAlgResult; }
protected override BaseSentenceAlgorithmData InitSourceData(List<BaseSentenceAlgorithm> algorithms) { _predicateIds = algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.Predicate.PredicateModalityCheck.InternalName).ColumnValues<int>(HelperDataPredicateModalityCheckRootOldPredicateId.Name).ToList(); return algorithms.FindByInternalName(AlgorithmNames.Subject.SubjectUpdateStage1.InternalName).AlgResult; }
protected override BaseSentenceAlgorithmData InitSourceData(List<BaseSentenceAlgorithm> algorithms) { DirectObjects = new List<DirectObject>(); var sentence = algorithms.FindByInternalName(AlgorithmNames.DirectObject.StandartDirectObject.InternalName).AlgResult.Sentence; var data = algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.DirectObject.StandartDirectObject.InternalName); _prepareDirectObject(data, HelperDataStandartDirectObjectId.Name, HelperDataStandartDirectObjectConrolPredicateId.Name, HelperDataStandartDirectObjectConrolPredicateNr.Name, DirectObjectType.Direct, sentence); data = algorithms.FindByInternalName(AlgorithmNames.DirectObject.WhichDirectObject.InternalName).AlgResult.HelperDataElements.Find(x => x.TableName == WhichDirectObject.MainHelperDataTableName); _prepareDirectObject(data, HelperDataWhichDirectObjectObjectMainObjectId.Name, HelperDataWhichDirectObjectObjectMainConrolPredicateId.Name, HelperDataWhichDirectObjectObjectMainConrolPredicateNr.Name, DirectObjectType.Which, sentence); data = algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.DirectObject.InfinitiveDirectObject.InternalName); _prepareDirectObject(data, HelperDataInfinitiveDirectObjectId.Name, HelperDataInfinitiveDirectObjectKSO4Id.Name, HelperDataInfinitiveDirectObjectKSONr.Name, DirectObjectType.Infinitive, sentence); return new BaseSentenceAlgorithmData(); }
private void _addDataActionsForRemoveSentenceElements(List<BaseSentenceAlgorithm> algorithms) { // ложные КСО ОЧ (ЭС) _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.FindElliptedNoun.InternalName), new FalsePESDeleteWordProcessingAction())); // Между И _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.BetweenAndI.InternalName), new BetweenIDeleteWordProcessingAction())); }
protected override BaseSentenceAlgorithmData InitSourceData(List<BaseSentenceAlgorithm> algorithms) { _uniformPartsFinalResults = algorithms.FindByInternalName(AlgorithmNames.DivorcedWords.RestoreToBe.InternalName).AlgResult.FinalResults.UniformPartsFinalResults; _firstPredicateIds = algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.DivorcedWords.RestoreToBe.InternalName) .ColumnIntPositiveValues(HelperDataParticleThisPredicateAfterParticle.Name); return algorithms.FindByInternalName(AlgorithmNames.DivorcedWords.RestoreToBe.InternalName).AlgResult; }
private void _addDataActionsForModifySyntacticRole(List<BaseSentenceAlgorithm> algorithms) { // ложный С _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.FindFalseConjunctionS.InternalName), new FalseSChangeSyntacticRolePostProcessingAction())); // ПСС _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.ConjunctedWordsForPSS.InternalName), new PSSChangeSyntacticRolePostProcessingAction())); // Квази ОЧ приложение _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.QuasiUniformPartsAttachmentMain.InternalName), new QuasiUPAttachmentChangeSyntacticRolePostProcessingAction())); }
private void _addDataActionsForModifyLemma(List<BaseSentenceAlgorithm> algorithms) { // новый текст для подлежащего _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.DirectObject.FalseDirectObjectReconstruction.InternalName), new SubstantDirectObjectChangeTextProcessingAction())); }
private void _addDataActionsForModifyPartOfSpeech(List<BaseSentenceAlgorithm> algorithms) { // частица И _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.FindFalseParticleI.InternalName), new ParticleIChangePartOfSpeechPostProcessingAction())); // союз С var data = new BaseSentenceAlgorithmData(); var falseSalg = algorithms.FindByInternalName(AlgorithmNames.UniformParts.FindFalseConjunctionS.InternalName) as FindFalseConjunctionS; data.Sentence = falseSalg.AlgResult.Sentence; data.HelperData = new GeneralHelperData(); if (falseSalg.FalseSIds != null) { foreach (var falseSSentenceElement in falseSalg.FalseSIds.Select(falseSId => data.Sentence.GetElement(falseSId))) { data.HelperData.Rows.Add(falseSSentenceElement.GUID, falseSSentenceElement.Id, falseSSentenceElement.Text); } } _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(data.HelperData, new FalseSChangePartOfSpeechPostProcessingAction())); }
private void _addDataActionsForDeleteConjunction(List<BaseSentenceAlgorithm> algorithms) { // Ложный С _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.FindFalseConjunctionS.InternalName), new FalseSDeleteConjunctionPostProcessingAction())); // ПСС и ССП _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.SubjectAndPredicateConjunction.InternalName), new SubjectAndPredicateDeleteConjunctionPostProcessingAction())); // Между И _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.BetweenAndI.InternalName), new BetweenIDeleteConjunctionPostProcessingAction())); // ложное эллипт. существительное _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.FindElliptedNoun.InternalName), new ElliptedNounDeleteConjunctionPostProcessingAction())); }
protected override BaseSentenceAlgorithmData InitSourceData(List<BaseSentenceAlgorithm> algorithms) { _upMergeHelperData = (UPRowsMergeHelperData)algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.UPRowsMerge.InternalName); return algorithms.FindByInternalName(AlgorithmNames.DivorcedWords.ComplementUniformParts.InternalName).AlgResult; }
protected override BaseSentenceAlgorithmData InitSourceData(List<BaseSentenceAlgorithm> algorithms) { // берем КСО сказуемые и смотрим в какие ряды ОЧ они входят var uniformPartsRows = algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.UPRowsMerge.InternalName); var predicatePartsRows = algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.Predicate.PredicateParts.InternalName); var result = new BaseSentenceAlgorithmData { Sentence = algorithms.FindByInternalName(AlgorithmNames.Predicate.PredicateParts.InternalName).AlgResult.Sentence, HelperData = new ConjunctedPredicatesSourceHelperData(Info.InternalName) }; foreach (DataRow row in predicatePartsRows.Rows) { var predicateGUID = row.Field<string>(HelperDataColumnElementGUID.Name); var uniformPartsInfoForPredicate = uniformPartsRows.AsEnumerable().ToList().Find(x => x.Field<string>(HelperDataColumnElementGUID.Name) == predicateGUID); var predicateId = row.Field<int>(HelperDataPredicatePartsIds.Name); var predicateOrder = row.Field<int>(HelperDataPredicatePartsOrder.Name); var predicateParent = row.Field<int>(HelperDataPredicatePartsParentId.Name); var predicateType = row.Field<string>(HelperDataPredicatePartsPredicateType.Name); var predicatePartParentId = row.Field<int>(HelperDataPredicatePartsPartParentId.Name); var predicateLevel = row.Field<int>(HelperDataPredicatePartsPredicatePartLevel.Name); var predicatePartType = row.Field<string>(HelperDataPredicatePartsPredicatePartType.Name); string predicateUPRowNr; if (uniformPartsInfoForPredicate != null) predicateUPRowNr = uniformPartsInfoForPredicate.Field<string>(HelperDataUPRowsUPMergeFullRowNr.Name); else predicateUPRowNr = ""; var realPredicatesData = algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.Predicate.IndependentInfinitive.InternalName); var predicateIsReal = realPredicatesData.AsEnumerable() .ToList() .Find(x => x.Field<int>(HelperDataIndependentInfinitiveTruePredicateIds.Name) == predicateId) != null; ((ConjunctedPredicatesSourceHelperData) result.HelperData).AddOrUpdateCustomRow(predicateGUID, predicateId, predicateOrder, predicateParent, predicatePartParentId, predicatePartType, predicateLevel, predicateType, predicateUPRowNr, predicateIsReal); } result.RestoreGapsInIdsAndTextsInHelperData(); return result; }
private void _addDataActionsForModifySyntacticParent(List<BaseSentenceAlgorithm> algorithms) { // ложный С _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.FindFalseConjunctionS.InternalName), new FalseSChangeSyntacticParentPostProcessingAction())); // ПСС _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.ConjunctedWordsForPSS.InternalName), new PSSChangeSyntacticParentPostProcessingAction())); // ПЭС _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.UPAdjectiveForElliptedNoun.InternalName), new PESChangeSyntacticParentPostProcessingAction())); // признак связи для ПЭС _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.ElliptedNounLinkFeature.InternalName), new PESFeatureLinkChangeSyntacticParentPostProcessingAction())); // квази ОЧ приложения _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.UniformParts.QuasiUniformPartsAttachmentMain.InternalName), new QuasiUPAttachmentChangeSyntacticParentPostProcessingAction())); // СПСС _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindByInternalName(AlgorithmNames.UniformParts.WordWithLostConjunction.InternalName).AlgResult.HelperDataElements.Find(x => x.TableName == WordWithLostConjunction.ResultTableName), new SPSSChangeSyntacticParentPostProcessingAction())); }
private void _addDataActionsForModifySurfaceSlot(List<BaseSentenceAlgorithm> algorithms) { // ЕСЛИ ТО _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.DivorcedWords.IfConjunction.InternalName), new IfConjunctionChangeSurfaceSlotProcessingAction())); _dataAndActions.Add(new KeyValuePair<BaseHelperData, BasePostProcessingAction>(algorithms.FindHelperDataTableByAlgInternalName(AlgorithmNames.DivorcedWords.ThenConjunction.InternalName), new ThenConjunctionChangeSurfaceSlotProcessingAction())); }