import java.util.*; import java.io.*; import java.lang.*; public class sisendx{ public static void main (String arg [])throws IOException{ int[] arv=null; String rida; int pikkus, kokku=0; BufferedReader sisse1=new BufferedReader(new InputStreamReader(System.in)); PrintWriter valja1=new PrintWriter (System.out, true); valja1.println ("Palun textifaili nimi kujul *.txt"); String failinimi=sisse1.readLine(); String tekst=Tekstiab.loeFail(failinimi); BufferedReader sisse2=new BufferedReader(new InputStreamReader(System.in)); System.out.println ("Palun säna"); String sona=sisse2.readLine().toLowerCase(); int i=0; StringTokenizer jagajaL=new StringTokenizer(tekst,".!?"); String laused[]=new String[jagajaL.countTokens()]; while (jagajaL. hasMoreTokens()){ String lause=jagajaL.nextToken(); StringTokenizer jagajaS=new StringTokenizer(lause," "); while (jagajaS.hasMoreTokens()){ String sona1=jagajaS.nextToken().toLowerCase(); if (sona1. equals (sona))laused[i++]=lause; }} int k=0; int u=0; StringTokenizer jagaja=new StringTokenizer(tekst," "); String sonad[]=new String[jagaja.countTokens()]; while(laused[k]!=null){ StringTokenizer jagajaS2=new StringTokenizer(laused[k++],", "); while (jagajaS2.hasMoreTokens()){ String sona2=jagajaS2.nextToken().toLowerCase(); sonad[u++]=sona2; }} sonad[u++]=sonad[0]; int p=0; try{ arv=new int[u]; while (sonad[p++]!=null){ int z=p; arv[p]=1; while (sonad[z++]!=null){ if(sonad[p]. equals(sonad[z])){ arv[p]++; }} for (int w=1; w