Mettre affichage dans une liste

Fermé
informatique1410 Messages postés 1 Date d'inscription jeudi 12 mai 2016 Statut Membre Dernière intervention 12 mai 2016 - 12 mai 2016 à 17:36
salam ,
j’espère y'a quelqu'un peut m'aidez : j'ai implémenter ce code et sera m'afficher ce résultat : are you okay are you fine

[are, you, okay, are, you, fine]
TF are 0.4
TF you 0.5
TF okay 0.25
TF fine 0.25

alors je veux mettre ces résultats dans une liste que-dois-je-faire !
voila le code s'il te plait aidez moi et dit moi que es ce que je dois rajouterai



import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class imene {

@SuppressWarnings("resource")
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub


// Calculating term frequency
try{


FileReader fr =new FileReader(new File("fine.txt"));
BufferedReader br=new BufferedReader(fr);

String str;

while((str = br.readLine())!= null)

{
System.out.println(str + "\n");
}
br.close();
}
catch(IOException e)
{
System.out.println("file not found ");
}
List<String> list = new ArrayList<>();
Scanner sc = new Scanner(new FileInputStream("fine.txt"));
while (sc.hasNext())
list.add(sc.next());
sc.close();
System.out.println(list);

for (int i = 0; i < list.size(); i++) {
String get = list.get(i);
double cmp=1;
for (int j = i+1; j < list.size(); j++) {
String get1 = list.get(j);
if (get.equals(get1)) {
cmp++;
list.remove(j);


}

}
cmp=cmp/list.size();
System.out.println("TF "+get +" "+ cmp);





}




}}