用java编辑一个查词程序

用java编写一到两个页面(登录页面为可选项),打开一个文本文件(有英文有中文的一段文字),找出其中的单词,排序输出(按字母顺序排序)。其他的内容自由发挥……有谁会的能帮帮我吗?qq:1659316570
图片说明图片说明图片说明


    public static void main(String[] args) {

        new FindWords().findWords("zero hello 你好world");

    }

    public void findWords(String input) {

        char[] source = input.toCharArray();
        int k = 0,
            wlen = source.length;

        // contains A-Z and whilespace
        StringBuffer word = new StringBuffer();
        while(k < wlen) {
            char w = source[k];
            if(Pattern.matches("[A-Za-z]|\\s", String.valueOf(w))) {
                word.append(w);
            }
            k++;
        }

        //result : zero hello world
        System.out.println(word);

        //asList
        //result : [zero, hello, world]
        List<String> words = Arrays.asList(word.toString().split("\\s"));
        System.out.println(words);

        //sort
        Collections.sort(words, new Comparator<String>() {

            @Override
            public int compare(String o1, String o2) {

                return o1.compareTo(o2);
            }
        });

        //result : [hello, world, zero]
        System.out.println(words);

    }

这个就是读文件的操作咯,用BufferInputStream.读到之后可以判断它们的ASCII码,英文字母在一定的范围内,拿到这一段范围,比较它们的值就知道了