public static void main(String [] args) {


        try {
            byte[] encoded = Files.readAllBytes(Paths.get("textfile.txt"));
            filestring = new String(encoded,Charset.defaultCharset());
            words = filestring.split("[-!~\\s]+");

            for(String word : words){
                uniquewords.add(word);
            }

            System.out.println("Number of Words: "+uniquewords.size());
        }catch(Exception e){
            e.printStackTrace();
        }
    }