void function ( String [ ] arg0 ) { int [ ] [ ] loc0 = readInput ( ) ; SimpleGoodTuring loc1 = new SimpleGoodTuring ( loc0 [ 0 ] , loc0 [ 1 ] ) ; loc1 . print ( ) ; }
like sampson 's sgt program , reads data from stdin and writes results to stdout . the input should contain two integers on each line , separated by whitespace . the first integer is a count ; the second is a count for that count . the input must be sorted in ascending order , and should not contain 0s . for example , valid input is : 1 10 2 6 3 4 5 2 8 1 this represents a collection in which 10 types occur once each , 6 types occur twice each , 4 types occur 3 times each , 2 types occur 5 times each , and one type occurs 10 times , for a total count of 52 . this input will produce the following output : r n p p -- -- -- -- 0 0 0.000 0.1923 1 10 0.01923 0.01203 2 6 0.03846 0.02951 3 4 0.05769 0.04814 5 2 0.09615 0.08647 8 1 0.1538 0.1448 the last column represents the smoothed probabilities , and the first item in this column represents the probability assigned to unseen items . concode_field_sep int MIN_INPUT concode_elem_sep double CONFID_FACTOR concode_elem_sep double[] logZ concode_elem_sep double TOLERANCE concode_elem_sep double[] rStar concode_elem_sep int rows concode_elem_sep double pZero concode_elem_sep double slope concode_elem_sep int[] n concode_elem_sep double[] p concode_elem_sep int[] r concode_elem_sep int bigN concode_elem_sep double intercept concode_elem_sep double bigNPrime concode_elem_sep double[] z concode_elem_sep double[] logR concode_field_sep double[] getProbabilities concode_elem_sep void compute concode_elem_sep void print concode_elem_sep double smoothed concode_elem_sep double getProbabilityForUnseen concode_elem_sep int row concode_elem_sep int[][] readInput concode_elem_sep int[] integerList2IntArray concode_elem_sep void findBestFit concode_elem_sep double sq concode_elem_sep void validate