//Scanner for sentences
import java.io.*;
import java.util.*;

public class TestScanner1 {
    public static void main(String[] args) throws IOException {
        Scanner s = 
            new Scanner(new BufferedReader(new FileReader("farrago.txt")));
	// stop at any period, ? or ! followed by whitespace
	s.useDelimiter("[.?!]\\s*");  

        while (s.hasNext()) {
	    String x = s.next();
            System.out.println(x + " ("+ x.length() + ")");
        }
        s.close();
    }
}

