public double spelling ( final String source ) { assert ( source . startsWith ( "|" ) ) ; assert ( source . endsWith ( "|" ) ) ; WordSpelling original = new WordSpelling ( source ) ; WordSpelling corrected = IntStream . range ( 0 , 1 ) . mapToObj ( i -> buildCorrection ( original ) ) . min ( Comparator . comparingDouble ( x -> x . sum ) ) . get ( ) ; return corrected . sum ; }
Spelling double .