Пример #1
0
        /// <summary>
        /// 日本語(動詞)の出力
        /// </summary>
        private void SetVerbSourceTextBox()
        {
            string        subject     = MasterFactory.GetMasterData <SubjectMaster>().GetData(ContainerFactory.SubjectList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1] + ContainerFactory.SubjectList.SelectedTENIOHA;
            VerbEndOfWord verbEndItem = (
                ContainerFactory.StepLevelComboBox._StepLevel != StepLevel.ALLSTEP ? (MasterFactory.GetMasterData <VerbEndOfWordMaster>().GetRangeGroupByGroupIdAndStepLevel(
                                                                                          ContainerFactory.VerbList.SelectedItem.Id, ContainerFactory.StepLevelComboBox._StepLevel)).ToList()
                                                                       : (MasterFactory.GetMasterData <VerbEndOfWordMaster>().GetRangeGroupByGroupId(ContainerFactory.VerbList.SelectedVerbGroupId)).ToList()
                )[(ContainerFactory.VerbList.SelectedEndOfWordItemId - 1 >= 0) ? ContainerFactory.VerbList.SelectedEndOfWordItemId - 1 : 0];

            string end = string.Empty;

            end = MasterFactory.GetMasterData <VerbEndOfWordMaster>().GetData(verbEndItem.Id, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];
            string verb = MasterFactory.GetMasterData <VerbMaster>().GetData(ContainerFactory.VerbList.SelectedItem.Id, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];
            //後付けマスタが表示されない。。マスタのGet処理作り直す?
            string timeValue = MasterFactory.GetMasterData <VerbAddEndOfWordMaster>().GetGroupByGroupIdData(verbEndItem.Id, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];

            //副詞
            string adverb         = MasterFactory.GetMasterData <AdverbMaster>().GetData(ContainerFactory.AdverbList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];
            string nounPossessive = MasterFactory.GetMasterData <PossessiveMaster>().GetData(ContainerFactory.NounList.SelectedPossessiveId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];
            string article        = MasterFactory.GetMasterData <ArticleMaster>().GetData(ContainerFactory.NounList.SelectedArticleId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];
            //前置詞
            string prePosition = MasterFactory.GetMasterData <PrepositionMaster>().GetData(
                MasterFactory.GetMasterData <VerbConnectionMaster>().GetGroupByGroupIdData(ContainerFactory.VerbList.SelectedItem.Id), ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];
            //名詞
            string noun = (MasterFactory.GetMasterData <NounMaster>().GetData(
                               ContainerFactory.NounList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1] == string.Empty) ?
                          string.Empty
                : ((prePosition == string.Empty) ?
                   MasterFactory.GetMasterData <NounMaster>().GetData(ContainerFactory.NounList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1] + "に"
                : string.Empty);
            string personPossessive = MasterFactory.GetMasterData <PossessiveMaster>().GetData(ContainerFactory.PersonPrepositionList.SelectedPossessiveId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];
            string personArticle    = MasterFactory.GetMasterData <ArticleMaster>().GetData(ContainerFactory.PersonPrepositionList.SelectedArticleId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];
            //名詞
            string person = MasterFactory.GetMasterData <NounMaster>().GetData(ContainerFactory.PersonPrepositionList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];

            person = (person == string.Empty) ? person : person + "と";
            string locationPossessive = MasterFactory.GetMasterData <PossessiveMaster>().GetData(ContainerFactory.LocationPrepositionList.SelectedPossessiveId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];
            string locationArticle    = MasterFactory.GetMasterData <ArticleMaster>().GetData(ContainerFactory.LocationPrepositionList.SelectedArticleId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];
            //名詞
            string location = MasterFactory.GetMasterData <NounMaster>().GetData(ContainerFactory.LocationPrepositionList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];

            parent.SourceViewLabel.Text = subject + timeValue +
                                          ((person == string.Empty) ? string.Empty : personPossessive + personArticle + person)
                                          + ((location == string.Empty) ? string.Empty : locationPossessive + locationArticle + location)
                                          + ((noun == string.Empty) ? string.Empty : nounPossessive + article + noun + prePosition)
                                          + adverb
                                          + verb
                                          + end;
        }
Пример #2
0
        /// <summary>
        /// 動詞の出力
        /// </summary>
        private void SetVerbResultTextBox()
        {
            string subject = MasterFactory.GetMasterData <SubjectMaster>().GetData(ContainerFactory.SubjectList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];

            VerbEndOfWord verbEndItem = (
                ContainerFactory.StepLevelComboBox._StepLevel != StepLevel.ALLSTEP ? (MasterFactory.GetMasterData <VerbEndOfWordMaster>().GetRangeGroupByGroupIdAndStepLevel(
                                                                                          ContainerFactory.VerbList.SelectedItem.Id, ContainerFactory.StepLevelComboBox._StepLevel)).ToList()
                                                                                   : (MasterFactory.GetMasterData <VerbEndOfWordMaster>().GetRangeGroupByGroupId(ContainerFactory.VerbList.SelectedVerbGroupId)).ToList()
                )[(ContainerFactory.VerbList.SelectedEndOfWordItemId - 1 >= 0) ? ContainerFactory.VerbList.SelectedEndOfWordItemId - 1 : 0];
            string end = string.Empty;

            end = MasterFactory.GetMasterData <VerbEndOfWordMaster>().GetData(verbEndItem.Id, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];
            string verb = MasterFactory.GetMasterData <VerbMaster>().GetData(ContainerFactory.VerbList.SelectedItem.Id, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];
            //後付けマスタが表示されない。。マスタのGet処理作り直す?
            string timeValue = MasterFactory.GetMasterData <VerbAddEndOfWordMaster>().GetGroupByGroupIdData(verbEndItem.Id, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];

            //副詞
            string adverbFront  = string.Empty;
            string adverbMiddle = string.Empty;
            string adverbBack   = string.Empty;

            switch (MasterFactory.GetMasterData <AdverbMaster>().GetAdverbPosFromId(ContainerFactory.AdverbList.SelectedItemIndex))
            {
            case AdverbPosition.Front:
                adverbFront = MasterFactory.GetMasterData <AdverbMaster>().GetData(ContainerFactory.AdverbList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0] + " ";
                break;

            case AdverbPosition.Middle:
                adverbMiddle = MasterFactory.GetMasterData <AdverbMaster>().GetData(ContainerFactory.AdverbList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0] + " ";
                break;

            case AdverbPosition.Back:
                adverbBack = " " + MasterFactory.GetMasterData <AdverbMaster>().GetData(ContainerFactory.AdverbList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];
                break;
            }
            //冠詞
            string article = MasterFactory.GetMasterData <ArticleMaster>().GetData(ContainerFactory.NounList.SelectedArticleId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];
            //前置詞が共通になっているので各名詞リスト毎にする。
            string nounPossessive = MasterFactory.GetMasterData <PossessiveMaster>().GetData(ContainerFactory.NounList.SelectedPossessiveId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];
            //前置詞
            int    prepositionid = MasterFactory.GetMasterData <VerbConnectionMaster>().GetGroupByGroupIdData(ContainerFactory.VerbList.SelectedItem.Id);
            string prePosition   = MasterFactory.GetMasterData <PrepositionMaster>().GetData(prepositionid, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];
            //名詞
            string noun = MasterFactory.GetMasterData <NounMaster>().GetData(ContainerFactory.NounList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];

            if (noun.Contains("@冠詞@"))
            {
                noun = noun.Replace("@冠詞@", article + " ");
            }
            string personPossessive = MasterFactory.GetMasterData <PossessiveMaster>().GetData(ContainerFactory.PersonPrepositionList.SelectedPossessiveId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];
            //冠詞
            string personArticle = MasterFactory.GetMasterData <ArticleMaster>().GetData(ContainerFactory.PersonPrepositionList.SelectedArticleId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];

            //名詞
            string person = MasterFactory.GetMasterData <NounMaster>().GetData(ContainerFactory.PersonPrepositionList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];

            if (person.Contains("@冠詞@"))
            {
                person = person.Replace("@冠詞@", personArticle + " ");
            }
            string locationPossessive = MasterFactory.GetMasterData <PossessiveMaster>().GetData(ContainerFactory.LocationPrepositionList.SelectedPossessiveId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];
            //前置詞
            string locationPreposition = MasterFactory.GetMasterData <NounConnectionMaster>().GetGroupByGroupIdData(
                (ContainerFactory.LocationPrepositionList.SelectedItem == null) ? 0 : ContainerFactory.LocationPrepositionList.SelectedItem.Id);
            //冠詞
            string locationArticle = MasterFactory.GetMasterData <ArticleMaster>().GetData(ContainerFactory.LocationPrepositionList.SelectedArticleId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];

            //名詞
            string location = MasterFactory.GetMasterData <NounMaster>().GetData(ContainerFactory.LocationPrepositionList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];

            if (location.Contains("@冠詞@"))
            {
                location = location.Replace("@冠詞@", locationArticle + " ");
            }

            //文中の副詞を語尾に結合
            if (adverbMiddle != string.Empty)
            {
                string targetVerb;
                switch (verbEndItem.TimeType)
                {
                case TimeType.Current:
                    targetVerb = MasterFactory.GetMasterData <VerbMaster>().GetData(ContainerFactory.VerbList.SelectedItem.Id, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];
                    end        = end.Replace(targetVerb, adverbMiddle + " " + targetVerb);
                    break;

                case TimeType.Past:
                    targetVerb = MasterFactory.GetMasterData <EnglishWordMaster>().GetData(ContainerFactory.VerbList.SelectedItem.PastVerbId);
                    end        = end.Replace(targetVerb, adverbMiddle + " " + targetVerb);
                    break;

                case TimeType.Progressing:
                    targetVerb = MasterFactory.GetMasterData <EnglishWordMaster>().GetData(ContainerFactory.VerbList.SelectedItem.ProgressingId);
                    end        = end.Replace(targetVerb, adverbMiddle + " " + targetVerb);
                    break;

                case TimeType.PastParticiple:
                    targetVerb = MasterFactory.GetMasterData <EnglishWordMaster>().GetData(ContainerFactory.VerbList.SelectedItem.PastParticipleId);
                    end        = end.Replace(targetVerb, adverbMiddle + " " + targetVerb);
                    break;
                }
            }

            //変換結果
            parent.ResultLabel.Text = (CultureInfo.CurrentCulture.TextInfo.ToTitleCase(adverbFront) + subject + " " + end + " " + adverbBack
                                       + ((noun == string.Empty) ? "" : " " + prePosition + " " + nounPossessive + ((article == string.Empty) ? "" : " " + article) + " " + noun)
                                       + ((person == string.Empty) ? "" : " " + "with " + " " + personPossessive + ((personArticle == string.Empty) ? "" : " " + personArticle) + " " + person)
                                       + ((location == string.Empty) ? "" : " " + locationPreposition + " " + locationPossessive + ((locationArticle == string.Empty) ? "" : " " + locationArticle) + " " + location)
                                       + ((timeValue == string.Empty) ? "" : " " + timeValue))
                                      //.Replace(be, adverbMiddle + be)
                                      .Replace("  ", " ");
        }