コード例 #1
0
        /// <summary>
        /// 日本語(存在)の出力
        /// </summary>
        private void SetBeingSourceTextBox()
        {
            string    subject  = MasterFactory.GetMasterData <SubjectMaster>().GetData(ContainerFactory.SubjectList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1] + ContainerFactory.SubjectList.SelectedTENIOHA;
            BeingWord tempWord = (ContainerFactory.StepLevelComboBox._StepLevel == StepLevel.ALLSTEP) ?
                                 MasterFactory.GetMasterData <BeingWordMaster>().GetRangeIdPersonalPronounAndSubjectMaster(
                ContainerFactory.SubjectList._PersonalCategory
                , ContainerFactory.SubjectList._Subject).ToList()[ContainerFactory.BeingList.SelectedItemIndex]
                 : MasterFactory.GetMasterData <BeingWordMaster>().GetRangeIdPersonalPronounSubjectAndStepLevelMaster(
                ContainerFactory.StepLevelComboBox._StepLevel
                , ContainerFactory.SubjectList._PersonalCategory
                , ContainerFactory.SubjectList._Subject).ToList()[ContainerFactory.BeingList.SelectedItemIndex];
            string endVerb = MasterFactory.GetMasterData <BeingWordMaster>().GetData(tempWord.Id, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];
            //後付けマスタ
            List <List <string> > tempTimeValue = MasterFactory.GetMasterData <BeingAddWordMaster>().GetRangeData(tempWord.Id, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType);

            string timeWord = (tempTimeValue.Count == 0) ? string.Empty : tempTimeValue[0][1];
            //副詞
            string adverb           = MasterFactory.GetMasterData <AdverbMaster>().GetData(ContainerFactory.AdverbList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];
            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 prePosition = MasterFactory.GetMasterData <PrepositionMaster>().GetData(
                MasterFactory.GetMasterData <BeingConnectionMaster>().GetGroupByGroupIdData(ContainerFactory.BeingList.SelectedItemId), ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];
            //名詞
            string person = MasterFactory.GetMasterData <NounMaster>().GetData(ContainerFactory.PersonPrepositionList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[1];

            person += (person == string.Empty) ? string.Empty : "と";
            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 + timeWord
                                          + ((person == string.Empty) ? string.Empty : personPossessive + personArticle + person)
                                          + ((location == string.Empty) ? string.Empty : locationPossessive + locationArticle + location)
                                          + adverb + endVerb;
        }
コード例 #2
0
        /// <summary>
        /// 存在の出力
        /// </summary>
        private void SetBeingResultTextBox()
        {
            string subject = MasterFactory.GetMasterData <SubjectMaster>().GetData(ContainerFactory.SubjectList.SelectedItemId, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];

            BeingWord tempWord = (ContainerFactory.StepLevelComboBox._StepLevel == StepLevel.ALLSTEP) ?
                                 MasterFactory.GetMasterData <BeingWordMaster>().GetRangeIdPersonalPronounAndSubjectMaster(
                ContainerFactory.SubjectList._PersonalCategory
                , ContainerFactory.SubjectList._Subject).ToList()[ContainerFactory.BeingList.SelectedItemIndex]
                : MasterFactory.GetMasterData <BeingWordMaster>().GetRangeIdPersonalPronounSubjectAndStepLevelMaster(
                ContainerFactory.StepLevelComboBox._StepLevel
                , ContainerFactory.SubjectList._PersonalCategory
                , ContainerFactory.SubjectList._Subject).ToList()[ContainerFactory.BeingList.SelectedItemIndex];
            string be = MasterFactory.GetMasterData <BeingWordMaster>().GetData(tempWord.Id, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];
            //後付けマスタ
            List <List <string> > tempTimeValue = MasterFactory.GetMasterData <BeingAddWordMaster>().GetRangeData(tempWord.Id, ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType);

            string timeValue        = (tempTimeValue.Count == 0) ? string.Empty: tempTimeValue[0][0];
            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 + " ");
            }

            //副詞
            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 prePosition = MasterFactory.GetMasterData <PrepositionMaster>().GetData(
                MasterFactory.GetMasterData <BeingConnectionMaster>().GetGroupByGroupIdData(ContainerFactory.BeingList.SelectedItemId), ContainerFactory.JapaneseReadTypeComboBox._JapaneseReadType)[0];


            //文中に副詞を付ける。
            if (adverbMiddle != string.Empty)
            {
                if (be.Contains("going to be"))
                {
                    be = be.Replace("going to be", "going to be " + adverbMiddle);
                }
                else
                {
                    be = be + " " + adverbMiddle;
                }
            }

            parent.ResultLabel.Text = (CultureInfo.CurrentCulture.TextInfo.ToTitleCase(adverbFront) + subject + " " + be + adverbBack
                                       + ((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("  ", " ");
        }