예제 #1
0
파일: Program.cs 프로젝트: utunga/xtract
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                PrintUsageAndExit();
            }

            ITask task=null;
            switch (args[0])
            {
                case "SampleStream":
                    task = new SampleStream();
                    break;

                case "GenerateWords":
                    IUrlExpander expander = new UrlExpander();
                    Tokenizer tokenizer = new Tokenizer(expander);
                    task = new GenerateWords(tokenizer);
                    break;

                case "PushToCouch":
                    IUrlExpander expander1 = new UrlExpander();
                    Tokenizer tokenizer1 = new Tokenizer(expander1);
                    task = new PushAllDataToCouch(tokenizer1);
                    break;

                case "UpdateSimilarityScores":
                    task = new UpdateSimilarityScores();
                    break;

                case "DownloadCandidatesData":
                    task = new DownloadCandidatesData();
                    break;

                default:
                    PrintUsageAndExit();
                    break;
            }

            task.Execute();
            Environment.Exit(0); ;
        }
예제 #2
0
 public PushAllDataToCouch(Tokenizer tokenizer)
 {
     _tokenizer = tokenizer;
 }
예제 #3
0
파일: Tokenizer.cs 프로젝트: utunga/xtract
 //Helper static method
 public static string[] GetWords(string source)
 {
     IUrlExpander expander = new UrlExpander();
     Tokenizer tokenizer = new Tokenizer(expander);
     return new List<string>(tokenizer.Tokenize(source)).ToArray();
 }