Example #1
0
 public Entity(string name, ILanguageGenerator generator) : base(name, generator)
 {
     Name       = name;
     Supers     = new List <Entity>();
     Subs       = new List <Entity>();
     Attributes = new List <AttributeData>();
 }
Example #2
0
        public void Setup()
        {
            mockCollectionsSelector = new Mock <ICollectionSelector>();
            languageGenerator       = new LanguageGenerator(mockCollectionsSelector.Object);

            skills             = new List <Skill>();
            automaticLanguages = new List <string>();
            bonusLanguages     = new List <string>();
            abilities          = new Dictionary <string, Ability>();

            creature = "my creature";

            AddSkill("skill 1");
            AddSkill("skill 2");
            automaticLanguages.Add("lang 1");
            automaticLanguages.Add("lang 2");
            bonusLanguages.Add("lang 1");
            bonusLanguages.Add("lang 2");
            bonusLanguages.Add("lang 3");

            abilities[AbilityConstants.Intelligence] = new Ability(AbilityConstants.Intelligence);

            var index = 0;

            mockCollectionsSelector
            .Setup(s => s.SelectRandomFrom(It.IsAny <IEnumerable <string> >()))
            .Returns((IEnumerable <string> ss) => ss.ElementAt(index++ % ss.Count()));
            mockCollectionsSelector
            .Setup(s => s.SelectFrom(TableNameConstants.Collection.LanguageGroups, creature + LanguageConstants.Groups.Automatic))
            .Returns(automaticLanguages);
            mockCollectionsSelector
            .Setup(s => s.SelectFrom(TableNameConstants.Collection.LanguageGroups, creature + LanguageConstants.Groups.Bonus))
            .Returns(bonusLanguages);
        }
    public string[] Generate(ILanguageGenerator language)
    {
        CheckPrimitives(language);

        var code = language.ParseDesc(m_desc, this);

        foreach (var pkt in m_pkts)
        {
            var gc = language.Generate(pkt, this);
            for (var i = 0; i < code.Length; ++i)
            {
                code[i] += string.IsNullOrEmpty(gc[i]) ? "" : gc[i] + "\r\n";
            }
        }

        if (m_pkts.Count > 0)
        {
            for (var i = 0; i < code.Length; ++i)
            {
                code[i] = code[i].Length > 2 ? code[i].Substring(0, code[i].Length - 2) : code[i];
            }
        }

        return(code);
    }
        /// <summary>
        /// Implementation of lookup by locale.  This uses resourceId and ResourceExplorer to lookup.
        /// </summary>
        /// <param name="context">context.</param>
        /// <param name="locale">locale to lookup.</param>
        /// <param name="languageGenerator">found LanguageGenerator.</param>
        /// <returns>true if found.</returns>
        public override bool TryGetGenerator(ITurnContext context, string locale, out ILanguageGenerator languageGenerator)
        {
            var lgm        = context.TurnState.Get <LanguageGeneratorManager>();
            var resourceId = string.IsNullOrEmpty(locale) ? this.ResourceId : this.ResourceId.Replace(".lg", $".{locale}.lg");

            return(lgm.LanguageGenerators.TryGetValue(resourceId, out languageGenerator));
        }
        private ITurnContext GetTurnContext(ILanguageGenerator lg)
        {
            var context = new TurnContext(new TestAdapter(), new Activity());

            context.TurnState.Add <ILanguageGenerator>(lg);
            return(context);
        }
Example #6
0
        private static void Generate(Express.ExpressListener listener, string outDir,
                                     ILanguageGenerator generator, IFunctionsGenerator functionsGenerator)
        {
            var names = new List <string>();

            var sd = listener.TypeData.Where(kvp => kvp.Value is SelectType).
                     Select(v => new { v.Key, v.Value }).
                     ToDictionary(t => t.Key, t => (SelectType)t.Value);

            generator.SelectData = sd;

            var ed = listener.TypeData.Where(kvp => kvp.Value is EnumType).
                     Select(v => new { v.Key, v.Value }).
                     ToDictionary(t => t.Key, t => (EnumType)t.Value);

            generator.EnumData = ed;

            foreach (var kvp in listener.TypeData)
            {
                var td = kvp.Value;
                File.WriteAllText(Path.Combine(outDir, $"{td.Name}.{generator.FileExtension}"), td.ToString());
                names.Add(td.Name);
            }

            generator.GenerateManifest(outDir, names);

            if (functionsGenerator != null)
            {
                functionsGenerator.SelectData = sd;
                var functionsPath = Path.Combine(outDir, functionsGenerator.FileName);
                File.WriteAllText(functionsPath, functionsGenerator.Generate(listener.FunctionData.Values));
            }
        }
Example #7
0
 /// <summary>
 /// Name will be a type name or a path.
 /// </summary>
 /// <returns></returns>
 public TypeReference(ILanguageGenerator generator, string type, bool isCollection, int rank, bool isGeneric)
 {
     this.generator    = generator;
     this.IsCollection = isCollection;
     this.Rank         = rank;
     this.IsGeneric    = isGeneric;
     this.type         = type;
 }
Example #8
0
        /// <summary>
        /// Creates a new planner.
        /// </summary>
        public MicroPlanner(ILanguageGenerator language_generator, IRoutingInterpreter interpreter)
        {
            _interpreter = interpreter;

            this.InitializeMachines();
            this.InitializeMessagesStack();

            this.SentencePlanner = new SentencePlanner(language_generator);
        }
        /// <summary>
        /// Generates instructions.
        /// </summary>
        /// <param name="route"></param>
        /// <param name="interpreter"></param>
        /// <param name="languageGenerator"></param>
        /// <returns></returns>
        public static List<Instruction> Generate(Route route, IRoutingInterpreter interpreter, ILanguageGenerator languageGenerator)
        {
            OsmSharp.Routing.ArcAggregation.ArcAggregator aggregator =
                new OsmSharp.Routing.ArcAggregation.ArcAggregator(interpreter);
            AggregatedPoint point =
                aggregator.Aggregate(route);

            return InstructionGenerator.Generate(point, interpreter, languageGenerator);
        }
Example #10
0
 public AbilitiesGenerator(IStatsGenerator statsGenerator, ILanguageGenerator languageGenerator, ISkillsGenerator skillsGenerator,
     IFeatsGenerator featsGenerator, ICollectionsSelector collectionsSelector)
 {
     this.statsGenerator = statsGenerator;
     this.languageGenerator = languageGenerator;
     this.skillsGenerator = skillsGenerator;
     this.featsGenerator = featsGenerator;
     this.collectionsSelector = collectionsSelector;
 }
 private void CheckPrimitives(ILanguageGenerator language)
 {
     foreach (var t in primitiveTypes)
     {
         if (string.IsNullOrEmpty(language.ParseType(t)))
         {
             throw new Exception(string.Format("Generator {0} does not implement full type support, missing type: {1}", language.GetType().Name, t));
         }
     }
 }
Example #12
0
        /// <summary>
        /// Creates a new planner.
        /// </summary>
        public MicroPlanner(ILanguageGenerator languageGenerator, IRoutingInterpreter interpreter)
        {
            _interpreter = interpreter;

            _machines = new List<MicroPlannerMachine>();
            this.InitializeMachines(_machines);
            this.InitializeMessagesStack();

            this.SentencePlanner = new SentencePlanner(languageGenerator);
        }
Example #13
0
        public CodeGenerator(ILanguageGenerator languageGenerator, TextWriter output,
                             String @namespace, String rootClassName, String hmdTypePrefix)
        {
            this.typeNameTable     = new CodeTypeNameTable();
            this.languageGenerator = (languageGenerator == null) ? CSharpLanguageGenerator.Instance : languageGenerator;
            this.output            = (output == null) ? Console.Out : output;

            this.@namespace    = @namespace;
            this.rootClassName = rootClassName;
            this.hmdTypePrefix = hmdTypePrefix;
        }
Example #14
0
        /// <summary>
        /// Generates instructions.
        /// </summary>
        /// <param name="route"></param>
        /// <param name="interpreter"></param>
        /// <param name="languageGenerator"></param>
        /// <returns></returns>
        public static List<Instruction> Generate(Route route, IRoutingInterpreter interpreter, ILanguageGenerator languageGenerator)
        {
            if (route == null) { throw new ArgumentNullException("route"); }
            if (route.Vehicle == null) { throw new InvalidOperationException("Vehicle not set on route: Cannot generate instruction for a route without a vehicle!"); }
            if (interpreter == null) { throw new ArgumentNullException("interpreter"); }
            if (languageGenerator == null) { throw new ArgumentNullException("languageGenerator"); }

            var aggregator = new ArcAggregator(interpreter);
            var point = aggregator.Aggregate(route);

			return InstructionGenerator.Generate(route, point, interpreter, languageGenerator);
        }
Example #15
0
        public AttributeData(ILanguageGenerator generator, string name, string type, int rank, bool isCollection, bool isGeneric, bool isDerived = false, bool isOptional = false, bool isInverse = false) :
            base(generator, name, isCollection, rank, isGeneric, type)
        {
            this.IsDerived  = isDerived;
            this.IsOptional = isOptional;
            this.IsInverse  = isInverse;

            // A derived attribute which replaces a base class's version of
            // the attribute will have a name that is a path to the
            // parent class' attribute of the form SELF\IfcNamedUnit.Dimensions.
            if (isDerived && Name.Contains("SELF\\"))
            {
                HidesParentAttributeOfSameName = true;
                Name = Name.Split('.').Last();
            }
        }
Example #16
0
        private ITurnContext GetTurnContext(string locale = null, ILanguageGenerator generator = null)
        {
            var resourceExplorer = new ResourceExplorer().LoadProject(GetProjectFolder(), monitorChanges: false);

            var context = new TurnContext(new TestAdapter(), new Activity()
            {
                Locale = locale ?? string.Empty, Text = string.Empty
            });

            context.TurnState.Add(resourceExplorer);
            context.TurnState.Add(new LanguageGeneratorManager(resourceExplorer));
            generator = generator ?? new MockLanguageGenerator();
            if (generator != null)
            {
                context.TurnState.Add <ILanguageGenerator>(generator);
            }

            return(context);
        }
        private ITurnContext GetTurnContext(string locale, ILanguageGenerator generator = null)
        {
            var context = new TurnContext(
                new TestAdapter()
                .UseResourceExplorer(resourceExplorer)
                .UseAdaptiveDialogs()
                .UseLanguageGeneration(resourceExplorer, generator ?? new MockLanguageGenerator()), new Activity()
            {
                Locale = locale, Text = string.Empty
            });

            context.TurnState.Add(new LanguageGeneratorManager(resourceExplorer));
            if (generator != null)
            {
                context.TurnState.Add <ILanguageGenerator>(generator);
            }

            return(context);
        }
Example #18
0
        public virtual async Task <Activity> BindToData(ITurnContext context, object data)
        {
            if (!string.IsNullOrEmpty(this.Template))
            {
                // if there is a message generator use that
                IActivityGenerator activityGenerator = context.TurnState.Get <IActivityGenerator>();
                if (activityGenerator != null)
                {
                    var result = await activityGenerator.Generate(
                        turnContext : context,
                        template : this.Template,
                        data : data).ConfigureAwait(false);

                    return(result);
                }

                // fallback to just text based LG if there is a language generator
                var message = Activity.CreateMessageActivity();
                message.Text  = this.Template;
                message.Speak = this.Template;

                ILanguageGenerator languageGenerator = context.TurnState.Get <ILanguageGenerator>();
                if (languageGenerator != null)
                {
                    var result = await languageGenerator.Generate(
                        turnContext : context,
                        template : Template,
                        data : data).ConfigureAwait(false);

                    if (result != null)
                    {
                        message.Text  = result;
                        message.Speak = result;
                    }
                }

                return(message as Activity);
            }

            return(null);
        }
        public virtual async Task <string> BindToData(ITurnContext turnContext, object data)
        {
            if (string.IsNullOrEmpty(this.Template))
            {
                throw new ArgumentNullException(nameof(this.Template));
            }

            ILanguageGenerator languageGenerator = turnContext.TurnState.Get <ILanguageGenerator>();

            if (languageGenerator != null)
            {
                var result = await languageGenerator.Generate(
                    turnContext,
                    template : Template,
                    data : data).ConfigureAwait(false);

                return(result);
            }

            return(null);
        }
Example #20
0
 public CreatureGenerator(IAlignmentGenerator alignmentGenerator,
                          ICreatureVerifier creatureVerifier,
                          ICollectionSelector collectionsSelector,
                          IAbilitiesGenerator abilitiesGenerator,
                          ISkillsGenerator skillsGenerator,
                          IFeatsGenerator featsGenerator,
                          ICreatureDataSelector creatureDataSelector,
                          IHitPointsGenerator hitPointsGenerator,
                          IArmorClassGenerator armorClassGenerator,
                          ISavesGenerator savesGenerator,
                          JustInTimeFactory justInTimeFactory,
                          IAdvancementSelector advancementSelector,
                          IAttacksGenerator attacksGenerator,
                          ISpeedsGenerator speedsGenerator,
                          IEquipmentGenerator equipmentGenerator,
                          IMagicGenerator magicGenerator,
                          ILanguageGenerator languageGenerator)
 {
     this.alignmentGenerator   = alignmentGenerator;
     this.abilitiesGenerator   = abilitiesGenerator;
     this.skillsGenerator      = skillsGenerator;
     this.featsGenerator       = featsGenerator;
     this.creatureVerifier     = creatureVerifier;
     this.collectionsSelector  = collectionsSelector;
     this.creatureDataSelector = creatureDataSelector;
     this.hitPointsGenerator   = hitPointsGenerator;
     this.armorClassGenerator  = armorClassGenerator;
     this.savesGenerator       = savesGenerator;
     this.justInTimeFactory    = justInTimeFactory;
     this.advancementSelector  = advancementSelector;
     this.attacksGenerator     = attacksGenerator;
     this.speedsGenerator      = speedsGenerator;
     this.equipmentGenerator   = equipmentGenerator;
     this.magicGenerator       = magicGenerator;
     this.languageGenerator    = languageGenerator;
 }
Example #21
0
 /// <summary>
 /// Creates a new scentence planner.
 /// </summary>
 /// <param name="generator"></param>
 public SentencePlanner(ILanguageGenerator generator)
 {
     _generator    = generator;
     _instructions = new List <Instruction>();
 }
        /// <summary>
        /// Generates instructions.
        /// </summary>
        /// <param name="point"></param>
        /// <param name="interpreter"></param>
        /// <param name="languageGenerator"></param>
        /// <returns></returns>
        public static List <Instruction> Generate(AggregatedPoint point, IRoutingInterpreter interpreter, ILanguageGenerator languageGenerator)
        {
            if (point == null)
            {
                throw new ArgumentNullException("route");
            }
            if (interpreter == null)
            {
                throw new ArgumentNullException("interpreter");
            }
            if (languageGenerator == null)
            {
                throw new ArgumentNullException("languageGenerator");
            }

            MicroPlanning.MicroPlanner planner = new MicroPlanning.MicroPlanner(languageGenerator, interpreter);
            return(planner.Plan(point));
        }
        /// <summary>
        /// Generates instructions.
        /// </summary>
        /// <param name="route"></param>
        /// <param name="interpreter"></param>
        /// <param name="languageGenerator"></param>
        /// <returns></returns>
        public static List <Instruction> Generate(Route route, IRoutingInterpreter interpreter, ILanguageGenerator languageGenerator)
        {
            if (route == null)
            {
                throw new ArgumentNullException("route");
            }
            if (route.Vehicle == null)
            {
                throw new InvalidOperationException("Vehicle not set on route: Cannot generate instruction for a route without a vehicle!");
            }
            if (interpreter == null)
            {
                throw new ArgumentNullException("interpreter");
            }
            if (languageGenerator == null)
            {
                throw new ArgumentNullException("languageGenerator");
            }

            OsmSharp.Routing.ArcAggregation.ArcAggregator aggregator =
                new OsmSharp.Routing.ArcAggregation.ArcAggregator(interpreter);
            AggregatedPoint point =
                aggregator.Aggregate(route);

            return(InstructionGenerator.Generate(point, interpreter, languageGenerator));
        }
Example #24
0
 public ExpressListener(ILanguageGenerator generator, ITestGenerator testGenerator)
 {
     this.generator     = generator;
     this.testGenerator = testGenerator;
 }
 /// <summary>
 /// Generates instructions.
 /// </summary>
 /// <param name="point"></param>
 /// <param name="interpreter"></param>
 /// <param name="language_generator"></param>
 /// <returns></returns>
 public static List<Instruction> Generate(AggregatedPoint point, IRoutingInterpreter interpreter, ILanguageGenerator language_generator)
 {
     MicroPlanning.MicroPlanner planner = new MicroPlanning.MicroPlanner(language_generator, interpreter);
     return planner.Plan(point);
 }
Example #26
0
 public CollectionTypeData(string name, ILanguageGenerator generator, IEnumerable <string> values) : base(name, generator)
 {
     this.Values = values;
 }
Example #27
0
 /// <summary>
 /// Creates a route tracker that tracks the given route and it's instructions.
 /// </summary>
 /// <param name="route"></param>
 /// <param name="interpreter"></param>
 /// <param name="languageGenerator"></param>
 public RouteTracker(Route route, IRoutingInterpreter interpreter, ILanguageGenerator languageGenerator)
 {
     _route        = route;
     _instructions = InstructionGenerator.Generate(route, interpreter, languageGenerator);
 }
        /// <summary>
        /// Generates instructions.
        /// </summary>
        /// <param name="point"></param>
        /// <param name="interpreter"></param>
        /// <param name="languageGenerator"></param>
        /// <returns></returns>
        public static List<Instruction> Generate(AggregatedPoint point, IRoutingInterpreter interpreter, ILanguageGenerator languageGenerator)
        {
            if (point == null) { throw new ArgumentNullException("route"); }
            if (interpreter == null) { throw new ArgumentNullException("interpreter"); }
            if (languageGenerator == null) { throw new ArgumentNullException("languageGenerator"); }

            MicroPlanning.MicroPlanner planner = new MicroPlanning.MicroPlanner(languageGenerator, interpreter);
            return planner.Plan(point);
        }
Example #29
0
 /// <summary>
 /// Implementation of lookup by locale.  This uses internal dictionary to lookup.
 /// </summary>
 /// <param name="context">Context for the current turn of conversation with the user.</param>\
 /// <param name="locale">locale.</param>
 /// <param name="languageGenerator">generator to return.</param>
 /// <returns>true if found.</returns>
 public override bool TryGetGenerator(ITurnContext context, string locale, out ILanguageGenerator languageGenerator)
 {
     return(this.LanguageGenerators.TryGetValue(locale, out languageGenerator));
 }
Example #30
0
 /// <summary>
 /// Creates a new microplanner.
 /// </summary>
 /// <param name="languageGenerator"></param>
 /// <param name="interpreter"></param>
 /// <returns></returns>
 public static MicroPlanner CreatePlanner(ILanguageGenerator languageGenerator, IRoutingInterpreter interpreter)
 {
     return new MicroPlanner(languageGenerator, interpreter);
 }
        public void Setup()
        {
            mockCollectionsSelector = new Mock<ICollectionsSelector>();
            mockLanguageSelector = new Mock<ILanguageCollectionsSelector>();
            languageGenerator = new LanguageGenerator(mockLanguageSelector.Object, mockCollectionsSelector.Object);
            race = new Race();

            race.BaseRace = "baserace";
            race.Metarace = "metarace";
            className = "class name";
        }
Example #32
0
 public SelectType(string name, ILanguageGenerator generator, IEnumerable <string> values) : base(name, generator, values)
 {
 }
Example #33
0
 /// <summary>
 /// Creates a new microplanner.
 /// </summary>
 /// <param name="languageGenerator"></param>
 /// <param name="interpreter"></param>
 /// <returns></returns>
 public static MicroPlanner CreatePlanner(ILanguageGenerator languageGenerator, IRoutingInterpreter interpreter)
 {
     return(new MicroPlanner(languageGenerator, interpreter));
 }
Example #34
0
 public WrapperType(string name, string wrappedType, ILanguageGenerator generator, bool isCollectionType, int rank) : base(name, generator)
 {
     this.IsCollectionType = isCollectionType;
     this.Rank             = rank;
     this.WrappedType      = wrappedType;
 }
Example #35
0
 /// <summary>
 /// Register ILanguageGenerator as default langugage generator.
 /// </summary>
 /// <param name="botAdapter">botAdapter to add services to.</param>
 /// <param name="resourceExplorer">resourceExporer to provide to LanguageGenerator.</param>
 /// <param name="languageGenerator">LanguageGenerator to use.</param>
 /// <returns>botAdapter.</returns>
 public static BotAdapter UseLanguageGeneration(this BotAdapter botAdapter, ResourceExplorer resourceExplorer, ILanguageGenerator languageGenerator)
 {
     DeclarativeTypeLoader.AddComponent(new LanguageGenerationComponentRegistration());
     botAdapter.Use(new RegisterClassMiddleware <LanguageGeneratorManager>(new LanguageGeneratorManager(resourceExplorer ?? throw new ArgumentNullException(nameof(resourceExplorer)))));
     botAdapter.Use(new RegisterClassMiddleware <ILanguageGenerator>(languageGenerator ?? throw new ArgumentNullException(nameof(languageGenerator))));
     return(botAdapter);
 }
Example #36
0
        /// <summary>
        /// Register ILanguageGenerator as default langugage generator.
        /// </summary>
        /// <param name="botAdapter">botAdapter to add services to.</param>
        /// <param name="resourceExplorer">resourceExporer to provide to LanguageGenerator.</param>
        /// <param name="languageGenerator">LanguageGenerator to use.</param>
        /// <returns>botAdapter.</returns>
        public static BotAdapter UseLanguageGeneration(this BotAdapter botAdapter, ResourceExplorer resourceExplorer, ILanguageGenerator languageGenerator)
        {
            DeclarativeTypeLoader.AddComponent(new LanguageGenerationComponentRegistration());

            lock (languageGeneratorManagers)
            {
                if (!languageGeneratorManagers.TryGetValue(resourceExplorer ?? throw new ArgumentNullException(nameof(resourceExplorer)), out var lgm))
                {
                    lgm = new LanguageGeneratorManager(resourceExplorer);
                    languageGeneratorManagers[resourceExplorer] = lgm;
                }

                botAdapter.Use(new RegisterClassMiddleware <LanguageGeneratorManager>(lgm));
                botAdapter.Use(new RegisterClassMiddleware <ILanguageGenerator>(languageGenerator ?? throw new ArgumentNullException(nameof(languageGenerator))));
                return(botAdapter);
            }
        }
Example #37
0
 /// <summary>
 /// Creates a new scentence planner.
 /// </summary>
 /// <param name="generator"></param>
 public SentencePlanner(ILanguageGenerator generator)
 {
     _generator = generator;
     _instructions = new List<Instruction>();
 }
Example #38
0
 /// <summary>
 /// Creates a route tracker that tracks the given route and it's instructions.
 /// </summary>
 /// <param name="route"></param>
 /// <param name="interpreter"></param>
 /// <param name="languageGenerator"></param>
 public RouteTracker(Route route, IRoutingInterpreter interpreter, ILanguageGenerator languageGenerator)
 {
     _route = route;
     _instructions = InstructionGenerator.Generate(route, interpreter, languageGenerator);
 }
Example #39
0
 public ParameterData(ILanguageGenerator generator, string name, bool isCollection, int rank, bool isGeneric, string type) : base(generator, type, isCollection, rank, isGeneric)
 {
     this.Name = name;
 }
        /// <summary>
        /// Register ILanguageGenerator as default langugage generator.
        /// </summary>
        /// <param name="dialogManager">botAdapter to add services to.</param>
        /// <param name="languageGenerator">LanguageGenerator to use.</param>
        /// <returns>botAdapter.</returns>
        public static DialogManager UseLanguageGeneration(this DialogManager dialogManager, ILanguageGenerator languageGenerator)
        {
            var resourceExplorer = dialogManager.TurnState.Get <ResourceExplorer>();

            lock (languageGeneratorManagers)
            {
                if (!languageGeneratorManagers.TryGetValue(resourceExplorer ?? throw new ArgumentNullException(nameof(resourceExplorer)), out var lgm))
                {
                    lgm = new LanguageGeneratorManager(resourceExplorer);
                    languageGeneratorManagers[resourceExplorer] = lgm;
                }

                dialogManager.TurnState.Add <LanguageGeneratorManager>(lgm);
                dialogManager.TurnState.Add <ILanguageGenerator>(languageGenerator ?? throw new ArgumentNullException(nameof(languageGenerator)));

                return(dialogManager);
            }
        }
Example #41
0
        /// <summary>
        /// Generates instructions.
        /// </summary>
        /// <param name="route"></param>
        /// <param name="point"></param>
        /// <param name="interpreter"></param>
        /// <param name="languageGenerator"></param>
        /// <returns></returns>
        public static List<Instruction> Generate(Route route, AggregatedPoint point, IRoutingInterpreter interpreter, ILanguageGenerator languageGenerator)
        {
            if (point == null) { throw new ArgumentNullException("route"); }
            if (interpreter == null) { throw new ArgumentNullException("interpreter"); }
            if (languageGenerator == null) { throw new ArgumentNullException("languageGenerator"); }

            return InstructionGenerator.Generate(new MicroPlanner(languageGenerator, interpreter), route, point);
        }