Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = Encoding.Unicode;

            Console.WriteLine("Initializing dictionary...");
            var dictionary = new DictionaryDataProvider();

            while (true)
            {
                Console.WriteLine("Enter a word");
                var w = Console.ReadLine();
                if (string.IsNullOrEmpty(w))
                {
                    break;
                }
                var card = dictionary.GetWordCard(w);
                if (card == null)
                {
                    Console.WriteLine("Word not found");
                    continue;
                }
                var newParserResult = dictionary.GetCardAsTags(card);
                Console.WriteLine("");
                Console.WriteLine(newParserResult.ConvertToNoTagsString());
                Console.WriteLine("Parsed");
            }
        }
Exemplo n.º 2
0
        void OnIndexStart(object sender, EventArgs e)
        {
            IsBusy = true;
            IndexStart.Invoke(this, new EventArgs());

            txtInputBox.IsEnabled = false;
            btnSearch.IsEnabled   = false;

            txtMessages.Text = "Getting file...";
            var dictFilePath = "data/dict.dsl";
            var resource     = Application.GetResourceStream(new Uri(dictFilePath, UriKind.Relative));

            DictStream = resource.Stream;

            txtMessages.Text = "Indexing in proccess...";
            DictionaryData   = new DictionaryDataProvider(DictStream);

            IsInitialized    = true;
            txtMessages.Text = string.Empty;

            txtInputBox.IsEnabled = true;
            btnSearch.IsEnabled   = true;

            IndexEnd.Invoke(this, new EventArgs());
        }