public void Execute(Selection selection, string[] args, AbstractTableWriter writer)
        {
            var vm = new NgramViewModel {
                Selection = selection
            };

            if (args.Length == 0)
            {
                vm.NGramSize = 5;
            }
            if (args.Length >= 1)
            {
                vm.NGramSize = int.Parse(args[0]);
            }
            if (args.Length >= 2)
            {
                vm.LayerDisplayname = args[1];
            }
            if (args.Length == 3)
            {
                vm.NGramMinFrequency = int.Parse(args[2]);
            }
            vm.Execute();

            writer.WriteTable(selection.Displayname, vm.GetDataTable());
        }
Example #2
0
        public void Execute(Selection selection, string[] args, AbstractTableWriter writer)
        {
            var arguments = args.ToList();
            var n         = int.Parse(arguments[0]);

            arguments.RemoveAt(0);
            var l1 = arguments[0];

            arguments.RemoveAt(0);
            var min = int.Parse(arguments[0]);

            arguments.RemoveAt(0);
            var l2 = arguments[0];

            arguments.RemoveAt(0);
            var any = bool.Parse(arguments[0]);

            arguments.RemoveAt(0);

            var vm = new NgramViewModel
            {
                Selection                     = selection,
                LayerDisplayname              = l1,
                NGramMinFrequency             = min,
                NGramSize                     = n,
                CorrespondingLayerValueFilter = new CorrespondingLayerValueFilterViewModel
                {
                    Layer1Displayname  = l1,
                    Layer2Displayname  = l2,
                    AnyMatch           = any,
                    Layer2ValueFilters = new HashSet <string>(arguments),
                    Selection          = selection
                }
            };

            vm.Execute();

            writer.WriteTable(selection.Displayname, vm.GetDataTable());
        }