static void Main(string[] args) { ITokenizer tokenizer = new ExactTokenizer(new char[] { ' ', ',', '-', '_', '#' }); Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); long time; Index index = readDataBase("data.txt"); FuzzyAnalyser analyser = new FuzzyAnalyser(tokenizer, index, +2); while (true) { string query = Console.ReadLine(); if (query == "exit") { return; } if (query == "update") { updateDataBase(tokenizer, "files", "data.txt"); index = readDataBase("data.txt"); analyser = new FuzzyAnalyser(tokenizer, index, +2); continue; } time = stopWatch.ElapsedMilliseconds; Dictionary <string, HashSet <string> > result = analyser.Analysis(query); Console.WriteLine("Analysis finished In " + (stopWatch.ElapsedMilliseconds - time) + " ms"); printQueryResult(result); } }
private void Start() { //Encontra os scripts necessários contidos no player: _playerEmotions = player.GetComponent <Emotions>(); _playerHealth = player.GetComponent <PlayerHealth>(); _playerMovement = player.GetComponent <PlayerMovement>(); //Encontra todos os objetos que terão suas cores modificadas _allColorControllers = FindObjectsOfType <ColorController>(); //Atualiza todos os dados a cada 3 segundos UpdateDataNow(); _data[2] = _data[1] = _data[0]; InvokeRepeating("UpdateAllData", 3f, 3f); FuzzyAnalyser.Init(); }