Exemplo n.º 1
0
        public LHippocampus GetContext()
        {
            string userId = "random_id";

            if (_contexts.ContainsKey(userId))
            {
                return(_contexts[userId]);
            }
            else
            {
                LHippocampus userContext = new LHippocampus();
                _contexts.Add(userId, userContext);

                return(userContext);
            }
        }
Exemplo n.º 2
0
        private LSyntagm GetSyntagmFromParse(Parse parse, LHippocampus context)
        {
            Parse[]         parseChildren = parse.GetChildren();
            List <LSyntagm> children      = new List <LSyntagm>();

            if (parseChildren.Length <= 1)
            {
                return(context?.ResolvePrim(parse.Value) ?? new LSyntagm(parse.Value));
            }

            foreach (var child in parseChildren)
            {
                children.Add(GetSyntagmFromParse(child, context));
            }

            return(GetSyntagmFromChildren(children));
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            LHippocampus logicka = new LHippocampus();

            var statement1 = logicka.Submit("My name is Ivan and my friend's name is Luka.");
            var statement2 = logicka.Submit("My name is Ivan and my friend's name is Luka.");

            var begin = DateTime.Now.Ticks;

            for (int i = 0; i < 100000; i++)
            {
                var result = statement1.Equals(statement2);
            }

            var end  = DateTime.Now.Ticks;
            var diff = end - begin;

            //logicka.SaveToFile(ConfigurationManager.AppSettings["LODBLocation"] + "english.lodb");
        }
 public TrainController()
 {
     _context = ContextFactory.GetInstance().GetContext();
 }