Exemplo n.º 1
0
        static void Main(string[] arguments)
        {
            switch (arguments.Length)
            {
            case 0: throw new ArgumentException($"Missing {nameof(arguments)}[0]: input-file-path.", nameof(arguments));

            case 1: throw new ArgumentException($"Missing {nameof(arguments)}[1]: output-file-path.", nameof(arguments));
            }

            var inputFilePath = arguments[0];
            var inputReader   = new RawDataReader(inputFilePath);

            const int knownWordDataCount = 6012;
            var       wordDataList       = new List <WordData>(knownWordDataCount);

            {
                inputReader.SkipLineWhile(line => !line.StartsWith("依字母排序 A"));
                inputReader.SkipLine(); // Line 6409: 依字母排序 A
                wordDataList.AddRange(inputReader.ReadWordData(113));
                inputReader.SkipLine(); // Line 6638: 高中英文參考詞彙表
                inputReader.SkipLine(); // Line 6639: 54
                wordDataList.AddRange(inputReader.ReadWordData(119));
                inputReader.SkipLine(); // Line 6760: 依字母排序 A
                inputReader.SkipLine(); // Line 6761: 55
                wordDataList.AddRange(inputReader.ReadWordData(119));
                inputReader.SkipLine(); // Line 6882: 高中英文參考詞彙表
                inputReader.SkipLine(); // Line 6883: 56
                wordDataList.AddRange(inputReader.ReadWordData(40));
                inputReader.SkipLine(); // Line 6924: B
                wordDataList.AddRange(inputReader.ReadWordData(78));
                inputReader.SkipLine(); // Line 7004: 依字母排序 B
                inputReader.SkipLine(); // Line 7005: 57
                wordDataList.AddRange(inputReader.ReadWordData(120));
                inputReader.SkipLine(); // Line 7126: 高中英文參考詞彙表
                inputReader.SkipLine(); // Line 7127: 58
                wordDataList.AddRange(inputReader.ReadWordData(114));
                inputReader.SkipLine(); // Line 7242: C
                wordDataList.AddRange(inputReader.ReadWordData(5));
                inputReader.SkipLine(); // Line 7248: 依字母排序
                inputReader.SkipLine(); // Line 7249: C
                inputReader.SkipLine(); // Line 7250: 59
                wordDataList.AddRange(inputReader.ReadWordData(113));

                {
                    // Line 7477

                    // chairperson/chair/
                    // chairman/
                    // chairwoman n.
                    // 6

                    var line   = string.Concat(inputReader.ReadLine(3));
                    var tokens = line.Split(Delimiter);
                    var level  = inputReader.ReadLine();
                    wordDataList.Add(new(tokens[0], tokens[1], level));
                }

                wordDataList.AddRange(inputReader.ReadWordData(4));
                inputReader.SkipLine(); // Line 7489: 高中英文參考詞彙表
                inputReader.SkipLine(); // Line 7490: 60
                wordDataList.AddRange(inputReader.ReadWordData(120));
                inputReader.SkipLine(); // Line 7611: 依字母排序 C
                inputReader.SkipLine(); // Line 7612: 61
                wordDataList.AddRange(inputReader.ReadWordData(120));
                inputReader.SkipLine(); // Line 7733: 高中英文參考詞彙表
                inputReader.SkipLine(); // Line 7734: 62
                wordDataList.AddRange(inputReader.ReadWordData(55));

                {
                    // Line 7790

                    // congressman/
                    // congresswoman n. 6

                    var line   = string.Concat(inputReader.ReadLine(2));
                    var tokens = line.Split(Delimiter);
                    wordDataList.Add(new(tokens[0], tokens[1], tokens[2]));
                }

                wordDataList.AddRange(inputReader.ReadWordData(63));
                inputReader.SkipLine(); // Line 7855: 依字母排序 C
                inputReader.SkipLine(); // Line 7856: 63
                wordDataList.AddRange(inputReader.ReadWordData(120));
                inputReader.SkipLine(); // Line 7977: 高中英文參考詞彙表
                inputReader.SkipLine(); // Line 7978: 64
                wordDataList.AddRange(inputReader.ReadWordData(56));
                inputReader.SkipLine(); // Line 8091: D
                wordDataList.AddRange(inputReader.ReadWordData(63));
                inputReader.SkipLine(); // Line 8218: 依字母排序 D
                inputReader.SkipLine(); // Line 8219: 65
                wordDataList.AddRange(inputReader.ReadWordData(120));
                inputReader.SkipLine(); // Line 8340: 高中英文參考詞彙表
                inputReader.SkipLine(); // Line 8341: 66
                wordDataList.AddRange(inputReader.ReadWordData(119));
                inputReader.SkipLine(); // Line 8462: 依字母排序 E
                inputReader.SkipLine(); // Line 8463: 67
                wordDataList.AddRange(inputReader.ReadWordData(73));
                inputReader.SkipLine(); // Line 8538: E
                wordDataList.AddRange(inputReader.ReadWordData(45));
                inputReader.SkipLine(); // Line 8584: 高中英文參考詞彙表
                inputReader.SkipLine(); // Line 8585: 68
                wordDataList.AddRange(inputReader.ReadWordData(120));
                inputReader.SkipLine(); // Line 8706: 依字母排序 F
                inputReader.SkipLine(); // Line 8707: 69
                wordDataList.AddRange(inputReader.ReadWordData(111));
                inputReader.SkipLine(); // Line 8820: F
                wordDataList.AddRange(inputReader.ReadWordData(7));
                inputReader.SkipLine(); // Line 8828: 高中英文參考詞彙表
                inputReader.SkipLine(); // Line 8829: 70
                wordDataList.AddRange(inputReader.ReadWordData(120));
                inputReader.SkipLine(); // Line 8950: 依字母排序 F
                inputReader.SkipLine(); // Line 8951: 71
                wordDataList.AddRange(inputReader.ReadWordData(120));
                inputReader.SkipLine(); // Line 9072: 高中英文參考詞彙表
                inputReader.SkipLine(); // Line 9073: 72
                wordDataList.AddRange(inputReader.ReadWordData(22));
                inputReader.SkipLine(); // Line 9118: G
                wordDataList.AddRange(inputReader.ReadWordData(97));
                inputReader.SkipLine(); // Line 9313: 依字母排序 H
                inputReader.SkipLine(); // Line 9314: 73
                wordDataList.AddRange(inputReader.ReadWordData(74));
                inputReader.SkipLine(); // Line 9389: H
                wordDataList.AddRange(inputReader.ReadWordData(45));
                inputReader.SkipLine(); // Line 9435: 高中英文參考詞彙表
                inputReader.SkipLine(); // Line 9436: 74
                wordDataList.AddRange(inputReader.ReadWordData(12));

                {
                    // Line 9449

                    // he (him, his, himself)
                    // pron. 1

                    var word   = inputReader.ReadLine();
                    var line   = inputReader.ReadLine();
                    var tokens = line.Split(Delimiter);
                    wordDataList.Add(new(word, tokens[0], tokens[1]));