Exemplo n.º 1
0
        public WordCountViewModel(string languageId, PhraseTranslator translator)
        {
            _languageId = languageId;
            _translator = translator;

            // Preserve character case for German (and potentially other languages in the future).
            _ignoreCase = _languageId != "de";

            CountNGramsCommand = new RelayCommand(CountNGrams, Can_CountNGrams);
            CountWordsCommand = new RelayCommand(CountWords, Can_CountWords);
            SortNGramsCommand = new RelayCommand(SortNGrams, Can_SortNGrams);
        }
Exemplo n.º 2
0
        public MainViewModel()
        {
            LanguageIds = Array.AsReadOnly(new[] { "de", "es", "fr", "ru" });
            Translator = new PhraseTranslator();

            CreatePhraseCommand = new RelayCommand(CreatePhrase, Can_CreatePhrase);
            DeletePhraseCommand = new RelayCommand(DeletePhrase, Can_DeletePhrase);
            IgnoreWordCommand = new RelayCommand(IgnoreWord, Can_IgnoreWord);
            LookupWordCommand = new RelayCommand(LookupWord, Can_LookupWord);
            SavePhraseCommand = new RelayCommand(SavePhrase, Can_SavePhrase);
            UnignoreWordCommand = new RelayCommand(UnignoreWord, Can_UnignoreWord);
            AddClusterCommand = new RelayCommand(AddCluster, Can_AddCluster);
            AddPhraseCommand = new RelayCommand(AddPhrase, Can_AddPhrase);
            DeleteClusterCommand = new RelayCommand(DeleteCluster, Can_DeleteCluster);
            AddToClusterCommand = new RelayCommand(AddToCluster, Can_AddToCluster);
        }
Exemplo n.º 3
0
        private void loadPhraseTranslations(string path)
        {
            Translator = new PhraseTranslator();
            Translator.LoadPhraseData(path);

            OnPropertyChanged("Translator");
            OnPropertyChanged("IgnoredWords");
            OnPropertyChanged("WordClusters");
        }