I'm working for a school project. Purpose of the program looking for the "Same" and "similar" words via input. I don't know how to find similar words numbers or just words.
FOR EXAMPLE:
INPUT: Car
OUTPUT: FOUND: CAR SIMILAR WORDS: 3(or the Words like 'carhood').
boolean cnt = false;
while(!cnt){
// Variables
ArrayList<String> WordList =
new ArrayList<>(Arrays.asList("açık",...."zorunda"));
String Word = "";
int WordIndex = 0;
int WordListSize = WordList.size();
boolean result = false;
System.out.print("Kelime Giriniz: ");
String Input = new Scanner(System.in).nextLine();
// Search Loop
for (int i = 0; i < WordListSize; i++) {
// Temporary variables
Word = WordList.get(i);
WordIndex = WordList.indexOf(Word);
// If there is word in word list
if(Word.equalsIgnoreCase(Input)) {
System.out.println("Kelime bulundu.");
System.out.println("Kelime : "+Word);
System.out.println("Kayıt Numarası : "+WordIndex);
// Comparison number
System.out.println(WordIndex+" Kelime ile karşılaştırıldı.");
result = true;
break;
}
}
if(!result) {
System.out.print("Kelime tarandı:");
System.out.println((WordList.size()));
System.out.println("Kelime bulunamadı.");
}
System.out.println("--");
System.out.println("Devam etmek ister misiniz ?");
System.out.println("'1' Evet, '0' Hayır.");
System.out.println("--");
int answer = new Scanner(System.in).nextInt();
if(answer ==0){
System.out.println("Çıkış yapaılıyor..");
cnt= true;
}
}
it is Turkish btw.