Beispiel #1
0
        public async Task <IActionResult> Index(WordViewModel model)
        {
            using (var ctx = new WordContext())
                using (var t = await ctx.Database.BeginTransactionAsync())
                {
                    var state   = new ListState();
                    var filters = new List <Func <Word, bool> >();

                    ViewBag.AppVer = App.Version;

                    if (model.Keyword != null)
                    {
                        filters.Add(w => w.Content.Contains(model.Keyword));
                    }

                    ViewBag.Data = await WordManipulator.LoadWords(ctx, state,
                                                                   w => w.Compact(),
                                                                   model,
                                                                   PageUtils.LimitPerPage,
                                                                   filters.ToArray());

                    ViewBag.State = state;

                    return(View(model));
                }
        }
Beispiel #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            using (var context = new WordContext())
            {
                context.Database.Migrate();
            }

            app.UseResponseCompression();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseStatusCodePages(async ctx =>
            {
                ctx.HttpContext.Response.ContentType = "text/html";
                int statusCode           = ctx.HttpContext.Response.StatusCode;
                string statusDescription = ReasonPhrases.GetReasonPhrase(statusCode);
                await ctx.HttpContext.Response.WriteAsync("<html lang=\"ko\">");
                await ctx.HttpContext.Response.WriteAsync("<head><style>body {text-align:center;} .desc{font-size:12pt;}</style></head>");
                await ctx.HttpContext.Response.WriteAsync($"<body>\r\n<h1>{statusCode} {statusDescription}</h1>\r\n");
                await ctx.HttpContext.Response.WriteAsync("<hr>\r\n");
                await ctx.HttpContext.Response.WriteAsync($"<span class=\"desc\">{App.Version}</span>\r\n");
                await ctx.HttpContext.Response.WriteAsync("</body></html>");
            });

            app.UseStaticFiles();
            app.UseHttpsRedirection();

            app.UseMvc(routes =>
            {
                routes.MapRoute("default", "{action=index}", defaults: new { controller = "main" });
            });
        }
Beispiel #3
0
 public async Task <IActionResult> UpdateRef(string word)
 {
     using (var ctx = new WordContext())
     {
         return(new WordResult(await WordManipulator.UpdateRef(ctx, word)));
     }
 }
Beispiel #4
0
        private string CheckTweet(string tweet)
        {
            WordContext db = new WordContext();

            var notAllowedWords = db.Words.ToList();

            if (tweet.Length > 140)
            {
                return("The tweet must be less than or equal 140 characters.");
            }

            if (string.IsNullOrEmpty(tweet))
            {
                return("Please type in a tweet and try again.");
            }

            foreach (var word in notAllowedWords)
            {
                if (tweet.ToLower().Split(' ').FirstOrDefault(o => o.Trim('.', ',', '/', '-') == word.WordText.ToLower()) != null)
                {
                    return($"The tweet contains word '{word.WordText}' which is not appropriate.");
                }
            }
            return("The tweet doesn't contain any inappropriate words. You can post it!");
        }
 /// <summary>
 /// Gets the words.
 /// </summary>
 /// <returns>
 /// A task to wait for before getting the words.
 /// </returns>
 /// <owner>Mariia Yelisieieva</owner>
 public async Task GetWordsAsync()
 {
     using (var context = new WordContext())
     {
         AllWords = await context.Words.ToListAsync();
     }
 }
Beispiel #6
0
        /// <summary>
        /// The method adds a word with certain difficuly in the database
        /// </summary>
        /// <example>
        /// <code>
        ///       WordAddBusiness.AddWord(word, out diff);
        /// </code>
        /// </example>
        /// <exception cref="HangManV2.Commons.WordAlreadyExistsExeption">Thrown when the word is already in the database
        /// <exception cref="HangManV2.Commons.WordUnplayableExeption">Thrown when the word is less than 3 symbols

        public static void AddWord(string word, out string difficulty)
        {
            try
            {
                CheckIfWordAlreadyInDB(word);
            }
            catch (WordAlreadyExistsExeption)
            {
                throw new WordAlreadyExistsExeption();
            }
            try
            {
                CheckIfWordPlayable(word);
            }
            catch (WordUnplayableExeption)
            {
                throw new WordUnplayableExeption();
            }
            difficulty = DetermineWordDifficulty(word);
            using (var dbcontext = new WordContext())
            {
                word newWord = new Data.word();
                newWord.Word1      = word;
                newWord.Difficulty = difficulty;
                dbcontext.Words.Add(newWord);
                dbcontext.SaveChanges();
            }
        }
        public void DeleteColod(int _id)
        {
            db     = new ColodContext();
            wordDb = new WordContext();

            db.Colods.Load(); // загрузка данных
            wordDb.Words.Load();

            ColodContext ColodContext = new ColodContext();
            WordContext  wordContext  = new WordContext();

            ModelColod card = ColodContext.Colods
                              .Where(x => x.Id == _id)
                              .FirstOrDefault();

            ColodContext.Colods.Remove(card);
            ColodContext.SaveChanges();

            ModelWord modelWord = wordContext.Words //удаление всех слов с таким же id колоды
                                  .Where(x => x.Colods == _id)
                                  .FirstOrDefault();

            if (modelWord != null)
            {
                wordContext.Words.Remove(modelWord);
                wordContext.SaveChanges();
            }
        }
Beispiel #8
0
 public UserService(WordContext wordContext, IOptions <AppSettings> appSettings
                    , UserManager <ApplicationUser> userManager
                    , SignInManager <ApplicationUser> signInManager)
 {
     _context       = wordContext;
     _appSettings   = appSettings.Value;
     _userManager   = userManager;
     _signInManager = signInManager;
 }
Beispiel #9
0
    public WordContext word()
    {
        WordContext _localctx = new WordContext(Context, State);

        EnterRule(_localctx, 6, RULE_word);
        try {
            State = 62;
            switch (TokenStream.La(1))
            {
            case IDENT:
                EnterOuterAlt(_localctx, 1);
                {
                    State = 58; Match(IDENT);

                    _localctx.symbols = PumpingLemma.ParserUtils.splitIntoAlphabetSymbols(TokenStream.GetText(_localctx.Start, TokenStream.Lt(-1)), alphabet);
                    if (_localctx.symbols == null)
                    {
                        word_error = TokenStream.GetText(_localctx.Start, TokenStream.Lt(-1));
                    }
                    else
                    {
                        _localctx.value = PumpingLemma.ParserUtils.wordToSymbolicString(_localctx.symbols);
                    }
                }
                break;

            case INT:
                EnterOuterAlt(_localctx, 2);
                {
                    State = 60; Match(INT);

                    _localctx.symbols = PumpingLemma.ParserUtils.splitIntoAlphabetSymbols(TokenStream.GetText(_localctx.Start, TokenStream.Lt(-1)), alphabet);
                    if (_localctx.symbols == null)
                    {
                        word_error = TokenStream.GetText(_localctx.Start, TokenStream.Lt(-1));
                    }
                    else
                    {
                        _localctx.value = PumpingLemma.ParserUtils.wordToSymbolicString(_localctx.symbols);
                    }
                }
                break;

            default:
                throw new NoViableAltException(this);
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
        /// <summary>
        /// Adds the specified word to the database.
        /// </summary>
        /// <param name="word">The word to add.</param>
        /// <owner>Mariia Yelisieieva</owner>
        public void Add(Word word)
        {
            using (var context = new WordContext())
            {
                context.Words.Add(word);
                context.SaveChanges();

                AllWords = context.Words.ToList();
            }
        }
Beispiel #11
0
 // <summary>
 /// The method chooses a random word with certain difficulty
 /// </summary>
 /// <example>
 /// <code>
 /// gamePlayBusiness = new GamePlayBusiness(WordChooser.ChooseWord(difficulty));
 /// </code>
 /// </example>
 public static string ChooseWord(string difficulty)
 {
     using (var dbcontext = new WordContext())
     {
         var idsOfCorrectDiff = (from word in dbcontext.Words where word.Difficulty == difficulty select word.Id).ToArray();
         int chosenId         = idsOfCorrectDiff[ChooseRandomNum(idsOfCorrectDiff.Length)];
         var chosenWord       = dbcontext.Words.Find(chosenId);
         return(chosenWord.Word1);
     }
 }
        /// <summary>
        /// Removes the specified word from the database.
        /// </summary>
        /// <param name="word">The word to remove.</param>
        /// <owner>Mariia Yelisieieva</owner>
        public void Remove(Word word)
        {
            using (var context = new WordContext())
            {
                var customer = context.Words.Single(x => x.Id == word.Id);
                context.Words.Remove(customer);
                context.SaveChanges();

                AllWords = context.Words.ToList();
            }
        }
Beispiel #13
0
        /// <summary>
        /// очистка словаря
        /// </summary>
        /// <returns></returns>
        public async Task <string> ClearDictionary()
        {
            using (WordContext db = new WordContext())
            {
                var exist = db.Words;
                db.Words.RemoveRange(exist);
                await db.SaveChangesAsync();

                return("\r\nСловарь очищен.");
            }
        }
        private WordContext GetContextWithData()
        {
            var options = new DbContextOptionsBuilder <WordContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;
            var context = new WordContext(options);

            context.AddRange(
                new Word
            {
                Phrase = "GOOD",
                Code   = "4663"
            },
                new Word
            {
                Phrase = "BAD",
                Code   = "223"
            },
                new Word
            {
                Phrase = "NO",
                Code   = "66"
            },
                new Word
            {
                Phrase = "ON",
                Code   = "66"
            },
                new Word
            {
                Phrase = "ROOT",
                Code   = "7668"
            },
                new Word
            {
                Phrase = "SNOT",
                Code   = "7668"
            },
                new Word
            {
                Phrase = "OUT",
                Code   = "688"
            },
                new Word
            {
                Phrase = "NUT",
                Code   = "688"
            }
                );
            context.SaveChanges();

            return(context);
        }
Beispiel #15
0
        public void DeleteCard(int _id)
        {
            db = new WordContext();
            db.Words.Load(); // загрузка данных
            WordContext WordContext = new WordContext();

            ModelWord card = WordContext.Words
                             .Where(x => x.Id == _id)
                             .FirstOrDefault();

            WordContext.Words.Remove(card);
            WordContext.SaveChanges();
        }
Beispiel #16
0
 public WordController(WordContext context)
 {
     db = context;
     if (!db.Words.Any())
     {
         db.Words.Add(new Word {
             RussWord = "карта", EnglWord = "map"
         });
         db.Words.Add(new Word {
             RussWord = "компьютер", EnglWord = "computer", AddRuss = "ЭВМ"
         });
         db.SaveChanges();
     }
 }
Beispiel #17
0
 /// <summary>
 /// The method checks if the iserted word is already i the database
 /// </summary>
 /// <example>
 /// <code>
 /// try
 /// {
 ///  CheckIfWordAlreadyInDB(word);
 ///  }
 /// </code>
 /// </example>
 /// <exception cref="HangManV2.Commons.WordAlreadyExistsExeption">Thrown when the word is already in the db
 /// </exception>
 private static void CheckIfWordAlreadyInDB(string imputWord)
 {
     using (var dbcontext = new WordContext())
     {
         var words = (from word in dbcontext.Words where word.Word1 == imputWord select word.Word1).ToList();
         try
         {
             CheckIfWordListEmpty(words);
         }
         catch (WordAlreadyExistsExeption)
         {
             throw new WordAlreadyExistsExeption();
         }
     }
 }
Beispiel #18
0
        public void AddCard(string _word, string _translate, int _progress, int _colods, bool _isChecked)
        {
            db = new WordContext();

            db.Words.Load(); // загрузка данных

            ModelWord AddCard = new ModelWord();

            AddCard.Word      = _word;
            AddCard.Translate = _translate;
            AddCard.IsChecked = _isChecked;
            AddCard.Progress  = _progress;
            AddCard.Colods    = _colods;
            db.Words.Add(AddCard);
            db.SaveChanges();
        }
        /// <summary>
        /// Updates the specified word from the database.
        /// </summary>
        /// <param name="word">The word with changed fields to update.</param>
        /// <owner>Mariia Yelisieieva</owner>
        public void Update(Word word)
        {
            using (var context = new WordContext())
            {
                AllWords = context.Words.ToList();

                Word wordToUpdate = AllWords.Single(x => x.Id == word.Id);

                wordToUpdate.Chinese  = word.Chinese;
                wordToUpdate.Pinyin   = word.Pinyin;
                wordToUpdate.English  = word.English;
                wordToUpdate.Progress = word.Progress;

                context.SaveChanges();
            }
        }
Beispiel #20
0
        /// <summary>
        /// Add a new word entry to the database.
        /// </summary>
        /// <param name="word">A word to add</param>
        /// <returns>Asynchronous operation to add a word</returns>
        public static async Task <Word> NewWord(WordContext ctx, string word)
        {
            if (string.IsNullOrWhiteSpace(word))
            {
                throw new ArgumentNullException(word);
            }

            var new_word = new Word()
            {
                Content = word, LastReferenced = DateTime.Now
            };

            ctx.Words.Add(new_word);
            await ctx.SaveChangesAsync();

            return(new_word);
        }
Beispiel #21
0
        public async Task <IActionResult> Add(string word)
        {
            using (var ctx = new WordContext())
                using (var t = await ctx.Database.BeginTransactionAsync())
                {
                    try
                    {
                        var new_word = await WordManipulator.NewWord(ctx, word);

                        t.Commit();
                        return(new WordResult(new_word));
                    }
                    catch (DbUpdateException)
                    {
                        return(new StatusCodeResult(StatusCodes.Status400BadRequest));
                    }
                }
        }
Beispiel #22
0
        /// <summary>
        /// дополнение словаря
        /// </summary>
        /// <returns></returns>
        public async Task <string> UpdateDictionary()
        {
            using (WordContext db = new WordContext())
            {
                Console.WriteLine("\r\n");
                var exist = db.Words.ToList();
                var words = await WordsFromFile();

                if (!words.Any())
                {
                    return("Файл не был выбран или в файле не было подходящих слов");
                }
                var  group = words.GroupBy(g => g);
                long i     = 0;
                var  list  = new List <Word>();
                var  count = group.Where(w => w.LongCount() >= 3).Count();
                foreach (var word in group.Where(w => w.LongCount() >= 3))
                {
                    var wordTitle = word.FirstOrDefault().ToLowerInvariant();
                    if (exist.Exists(x => x.Title == wordTitle))
                    {
                        var existWord = db.Words.FirstOrDefault(x => x.Title == wordTitle);
                        existWord.Count += word.LongCount();
                    }
                    else
                    {
                        list.Add(new Word
                        {
                            Title = wordTitle,
                            Count = word.LongCount()
                        });
                    }
                    var l = Console.CursorLeft;
                    var t = Console.CursorTop;
                    Console.Write(i * 100 / count + " %");
                    Console.SetCursorPosition(l, t);
                    i++;
                }
                db.Words.AddRange(list);
                await db.SaveChangesAsync();

                return("Словарь дополнен.");
            }
        }
        private async Task BuildResultListing()
        {
            var models            = new List <SearchResultItemModel>();
            var resultsInfoToShow = LinqExtensions.Skip(searchResults, (currentPage - 1) * ResultsPerPage).Take(ResultsPerPage).ToList();
            var fileIdToPathMap   = await Task.Run(() => folderManager.GetFilePathsFromIds(resultsInfoToShow.Select(x => x.FileId).ToArray()));

            foreach (var resultInfo in resultsInfoToShow)
            {
                if (fileIdToPathMap.TryGetValue(resultInfo.FileId, out string filePath) && File.Exists(filePath))
                {
                    var(context, wordIndexInContext) = await WordContext.GetContext(filePath, searchText, resultInfo.CharIndex);

                    var sr = new SearchResultItemModel
                    {
                        ColumnNumber       = resultInfo.ColumnNumber,
                        LineNumber         = resultInfo.LineNumber,
                        CharIndex          = resultInfo.CharIndex,
                        FileName           = Path.GetFileName(filePath),
                        SearchText         = searchText,
                        FilePath           = filePath,
                        Context            = context,
                        WordIndexInContext = wordIndexInContext
                    };
                    models.Add(sr);
                }
            }


            var factor = resultsPanel.ClientSize.Width < Screen.PrimaryScreen.Bounds.Width / 2 ? 1 : 0.75;

            resultsPanel.SuspendLayout();
            resultsPanel.Controls.Clear();
            foreach (var item in models)
            {
                var srItem = new SearchResultItem(item)
                {
                    Margin = new Padding(8, 0, 0, 8),
                    Width  = (int)(resultsPanel.ClientSize.Width * factor)
                };
                srItem.LinkFollowed += SrItem_LinkFollowed;
                resultsPanel.Controls.Add(srItem);
            }
            resultsPanel.ResumeLayout();
        }
Beispiel #24
0
        /// <summary>
        /// обработчик запросов
        /// </summary>
        /// <param name="obj">tcp client</param>
        static void SearchEngine(object obj)
        {
            try
            {
                var client = (TcpClient)obj;
                using (WordContext db = new WordContext())
                {
                    Console.WriteLine("Подключен клиент. Выполнение запроса...");
                    NetworkStream stream = client.GetStream();
                    byte[]        bytes  = new byte[client.ReceiveBufferSize];
                    stream.Read(bytes, 0, (int)client.ReceiveBufferSize);
                    var search   = Encoding.UTF8.GetString(bytes);
                    var response = new StringBuilder(string.Empty);
                    search = search.Replace("\0", "");
                    var words = db.Words.Where(x => x.Title.StartsWith(search)).OrderByDescending(x => x.Count).Take(5).ToList();
                    if (words.Any())
                    {
                        foreach (var word in words)
                        {
                            response.Append(word.Title);
                            response.Append("\r\n");
                        }

                        response.ToString();
                    }
                    else
                    {
                        response.Append("Слов не найдено. Измените запрос...\r\n");
                    }

                    byte[] data = Encoding.UTF8.GetBytes(response.ToString());
                    stream.Write(data, 0, data.Length);

                    Console.WriteLine("Отправлено сообщение: \r\n{0}", response);

                    stream.Close();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Beispiel #25
0
        public async Task <IActionResult> ChangeDetail(string word, RelatedType detail_type, string oldone, string newone)
        {
            using (var ctx = new WordContext())
            {
                switch (detail_type)
                {
                case RelatedType.Example:
                    return(new EnumResult(await WordManipulator.ChangeRelatedString(ctx, RelatedType.Example, word, oldone, newone)));

                case RelatedType.Synonym:
                    return(new EnumResult(await WordManipulator.ChangeRelatedWord(ctx, RelatedType.Synonym, word, oldone, newone)));

                case RelatedType.Antonym:
                    return(new EnumResult(await WordManipulator.ChangeRelatedWord(ctx, RelatedType.Antonym, word, oldone, newone)));

                default:
                    return(new StatusCodeResult(StatusCodes.Status400BadRequest));
                }
            }
        }
Beispiel #26
0
        public async Task <IActionResult> GetDetail(string word, RelatedType detail_type)
        {
            using (var ctx = new WordContext())
                using (var t = await ctx.Database.BeginTransactionAsync())
                {
                    switch (detail_type)
                    {
                    case RelatedType.Example:
                        return(new JsonResult(await WordManipulator.GetRelatedStrings(ctx, RelatedType.Example, word)));

                    case RelatedType.Synonym:
                        return(new JsonResult(await WordManipulator.GetRelatedWords(ctx, RelatedType.Synonym, word)));

                    case RelatedType.Antonym:
                        return(new JsonResult(await WordManipulator.GetRelatedWords(ctx, RelatedType.Antonym, word)));

                    default:
                        return(new StatusCodeResult(StatusCodes.Status400BadRequest));
                    }
                }
        }
Beispiel #27
0
    public WordContext word()
    {
        WordContext _localctx = new WordContext(Context, State);

        EnterRule(_localctx, 6, RULE_word);
        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 19; Match(WORD);
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
Beispiel #28
0
        public static async Task <List <string> > GetRelatedStrings(WordContext ctx, RelatedType type, string word)
        {
            if (string.IsNullOrWhiteSpace(word))
            {
                throw new ArgumentNullException(nameof(word));
            }
            if (!Enum.IsDefined(typeof(RelatedType), type) || type == RelatedType.None)
            {
                throw new ArgumentException(nameof(type));
            }
            var word_data = await ctx.Words
                            .Where(w => w.Content == word)
                            .Include(w => w.RelatedStrings)
                            .ToAsyncEnumerable()
                            .SingleOrDefault();

            return(await word_data.RelatedStrings
                   .Where(rs => rs.Type == type)
                   .Select(rs => rs.Content)
                   .ToAsyncEnumerable()
                   .ToList());
        }
Beispiel #29
0
        /// <summary>
        /// создание словаря
        /// </summary>
        /// <returns></returns>
        public async Task <string> CreateDictionary()
        {
            using (WordContext db = new WordContext())
            {
                Console.WriteLine("\r\n");
                var exist = db.Words.ToList();
                if (exist != null && exist.Any())
                {
                    return("Словарь не пуст. Для создания нового словаря сперва очистите старый.");
                }
                var words = await WordsFromFile();

                if (!words.Any())
                {
                    return("Файл не был выбран или в файле не было подходящих слов");
                }
                var  group = words.GroupBy(g => g);
                long i     = 0;
                var  list  = new List <Word>();
                foreach (var word in group.Where(w => w.LongCount() >= 3))
                {
                    list.Add(new Word
                    {
                        Title = word.FirstOrDefault(),
                        Count = word.LongCount()
                    });
                    var l = Console.CursorLeft;
                    var t = Console.CursorTop;
                    Console.Write(i * 100 / group.Where(w => w.LongCount() >= 3).Count() + " %");
                    Console.SetCursorPosition(l, t);
                    i++;
                }
                db.Words.AddRange(list);
                await db.SaveChangesAsync();

                return("Словарь создан.");
            }
        }
Beispiel #30
0
        /// <summary>
        /// Returns the value of a single word, including antonyms, synonyms, and examples.
        /// </summary>
        /// <typeparam name="T">Type</typeparam>
        /// <typeparam name="F">Type</typeparam>
        /// <param name="word">word</param>
        /// <param name="getter">getter</param>
        /// <returns>Asynchronous operation to get word data</returns>
        private static async Task <T> GetWordDetail <T, F>(WordContext ctx, string word, Func <Word, T> getter, Expression <Func <Word, ICollection <F> > > includer)
        {
            if (string.IsNullOrWhiteSpace(word))
            {
                throw new ArgumentNullException(nameof(word));
            }
            if (getter == null)
            {
                throw new ArgumentNullException(nameof(getter));
            }
            var word_data_query = ctx.Words
                                  .Where(w => w.Content == word);

            if (includer != null)
            {
                word_data_query = word_data_query.Include(includer);
            }
            var word_data = await word_data_query.ToAsyncEnumerable()
                            .SingleOrDefault();

            if (word_data == default(Word))
            {
                return(default);
	public WordContext word() {
		WordContext _localctx = new WordContext(Context, State);
		EnterRule(_localctx, 6, RULE_word);
		try {
			State = 62;
			switch (TokenStream.La(1)) {
			case IDENT:
				EnterOuterAlt(_localctx, 1);
				{
				State = 58; Match(IDENT);

						_localctx.symbols =  PumpingLemma.ParserUtils.splitIntoAlphabetSymbols(TokenStream.GetText(_localctx.Start, TokenStream.Lt(-1)), alphabet);
						if (_localctx.symbols == null)
							word_error = TokenStream.GetText(_localctx.Start, TokenStream.Lt(-1));
						else
							_localctx.value =  PumpingLemma.ParserUtils.wordToSymbolicString(_localctx.symbols);
					
				}
				break;
			case INT:
				EnterOuterAlt(_localctx, 2);
				{
				State = 60; Match(INT);

						_localctx.symbols =  PumpingLemma.ParserUtils.splitIntoAlphabetSymbols(TokenStream.GetText(_localctx.Start, TokenStream.Lt(-1)), alphabet);
						if (_localctx.symbols == null)
							word_error = TokenStream.GetText(_localctx.Start, TokenStream.Lt(-1));
						else
							_localctx.value =  PumpingLemma.ParserUtils.wordToSymbolicString(_localctx.symbols);
					
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}