[Solved] Write Java Program Tallies Letter Bigrams Standard Input Prints Tallies Standard Output Co Q37174239
write a java program that tallies the letter bigrams in standardinput, and prints those tallies to standard output. complete allthe tests
![In this array, for example tallies[tDh// stores the number of occurrences of bigram th tallies[116] [104] // same, sinc](https://media.cheggcdn.com/media%2F50d%2F50d5fc9c-0783-41b6-8276-49d45f5ec153%2FphpJlta3c.png)


Assignment You shall write a program that tallies the letter bigrams in standard input, and prints those tallies to standard output. A You shall write a program that tallies the letter bigrams in standard input, and prints those tallies to standard output Specifications 1. A letter shall be defined as any character that: a. Has a Unicode value< 8192 b. Is considered a letter, according to cCharacter.isLetter 2. All input shall be converted to lowercase 3. Each line of output shall consist of the following three values in order, separated by whitespace a. A bigram that occurred at least once in the input b. The number of occurrences of that bigram C. The proportional frequency of the bigram, relative to the total number of letter bigrams in the input, to double precision, rounded to 10 digits after the decimal point. -Rounding to 10 digits is easily accomplished using printf System . out . printf(“n digits: %.1ef%n”, Math.PI); to 10 4. Results shall be printed in lexicographical order of the bigrams, e.g. in the case of “no war but the class war” Tips There are two reasonable approaches to storing the bigram tallies, in CMPS 11-level programming 1. Use a “map” structure (which we have not yet learned about, though we should soon) 2. Use a two-dimensional array, where the first index is the Unicode value of the first letter in a bigram, and the second index is the second letter Since we have yet to go over maps, leave them aside and consider using a 2D array to store your tallies, e.g. as follows int[][] tallies -new int [8192] [8192]; In this array, for example tallies[‘t’D’h’// stores the number of occurrences of bigram “th” tallies[116] [104] // same, since tand ‘h’ are 116 and 104 in Unicode With this arrangement, producing results in lexicographical order would simply involve iterating the array by row and column, i.e. indexes [e][e] [e][1], [01 [8191], [1][e], [1][1], etc. Sample Executable and Testing The program cmps11_letter_bigrams on our server demonstrates a version of the expected behavior of your solution. Feel free to try it with multiple sorts of input, e.g cmps11 letter bigrams<<<“No War but the Class War” 0.1538461538 0.0769230769 0.0769230769 0.0769230769 0.0769230769 0.0769230769 0.0769230769 0.0769230769 0.0769230769 0.0769230769 0.1538461538 an as Lu no th ut Wa cmps11_letter_bigrams < /srv/datasets/chromosome11 543322 0.0774273224 351512 0.0500930874 523558 0.0746108091 422201 Θ.060|667021 529957 0.0755227130 499438 0.0711735344 187316 0.0152933077 527231 0.0751342383 419482 Θ.0597792249 386065 0.0550170603 492650 0.0702061952 355479 0.0506583336 347832 0.049 568 5887 426927 Θ.0608401914 530152 0.0755505019 554065 0.0789582777 ac at Ca Cg ct gc gt tc cmps11_letter_bigrams< /srv/datasets/shakespeare-othello.txt head 108 183 261 137 60 461 0.0012855153 0.0021782343 0.0031066621 0.0016307000 0.0007141752 0.0054872468 0.0000714175 0.0038208373 0.9025829336 0.0067132468 ac ae 321 217 564 al cmps11_letter_bigrams/srv/datasets/tolstoy-anna-karenina.txt sort -n -k2 r head 22915 0.0214067650 17459 ·0163098717 16293 ·0152296163 15993 0.0149403619 15586 0.0145601501 15412 0.0143976025 13489 0,0126811718 13339 0.0124610446 13090 0.0122284335 12352 0.0115390077 TO Ha He ал но он го ΠΟ ка Comparing Output You may find it useful to use a tool to compare your program’s output with that of the sample executable. The ⓗ diff utility is appropriate for this The following command uses process substitution to show any differences between the expected output and the output of a program in Java class Assignment02, both taking input from file/srv/datasets/genius.txt, without regard to amounts/types of whitespace diff <(cmps11-letter-bigrams </srv/datasets/genius . txt) 〈(java </srv/datasets/genius . txt) Assignment02 -uw In this case, if you see no output, that indicates no differences between the output of the two programs. Otherwise, any lines of output from diff starting with a -(minus) character are present only in the sample executable’s output, and any lines starting with a (plus) character are present only in the Java program’s output. Show transcribed image text Assignment You shall write a program that tallies the letter bigrams in standard input, and prints those tallies to standard output. A You shall write a program that tallies the letter bigrams in standard input, and prints those tallies to standard output Specifications 1. A letter shall be defined as any character that: a. Has a Unicode value
Expert Answer
Answer to write a java program that tallies the letter bigrams in standard input, and prints those tallies to standard output. com… . . .
OR

