Question
public class LibrariesLecture3{ // 5 points static int Q1(String word1, String word2) { // return the number of rhyming syllables between the two input words.
public class LibrariesLecture3{
// 5 points static int Q1(String word1, String word2) { // return the number of rhyming syllables between the two input words. We will define nthe number of rhyming // syllables as the number of syllables in the largest matching suffix of sounds between the words. This // is the same definition used by the provided library. // // Note: The cse115 library has been included in this project, but none of the classes have been imported.
return 0; }
public static void main(String[] args) {
}
}
package cse115.words;
import java.io.*; import java.util.*;
public class Words{
private static final String DIRECTORY = "/data/"; private static final String DICTIONARY_FILENAME = DIRECTORY + "cmudict-0.7b"; private static final String ADJECTIVES_FILENAME = DIRECTORY + "index.adj"; private static final String ADVERBS_FILENAME = DIRECTORY + "index.adv"; private static final String NOUNS_FILENAME = DIRECTORY + "index.noun"; private static final String SENSES_FILENAME = DIRECTORY + "index.sense"; private static final String VERB_FILENAME = DIRECTORY + "index.verb";
private static Map
/** * Return the number of syllables in the input word. */ public static int numberOfSyllables(String word){ int syllables = 0; List
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started