Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. public void getRules() throws FileNotFoundException, IOException, Exception{
  2. StringBuffer associate = associate();
  3. strRule = associate.toString();
  4. strRule = strRule.replace("FPGrowth found 157 rules\n", "");
  5. int l=0;
  6. StringTokenizer sto=new StringTokenizer(strRule.toLowerCase(),"\n");
  7. //review=new String[sto.countTokens()];
  8. while(sto.hasMoreTokens()){
  9. if(sto.nextToken()!=null){
  10. getFraseFromANN.add(sto.nextToken());
  11. }
  12.  
  13. System.out.println("frase:"+getFraseFromANN.get(l));
  14. l++;
  15. }
  16. for(int j=0;j<getFraseFromANN.size();j++){
  17. String depan[] = getFraseFromANN.get(j).split("\\=1");
  18. String belakang[] = null;
  19. String tmp = "";
  20. for(int i=0;i<depan.length;i++){
  21. if(depan[i].matches(".*\\[.*")){
  22. belakang = depan[i].split("\\[");
  23. if(belakang.length>2){
  24. tmp = tmp.concat(" "+belakang[1]+" ");
  25. }
  26. }else if(depan[i].matches("^, .*")){
  27. belakang = depan[i].split(",");
  28. tmp = tmp.concat(" "+belakang[1]+" ");
  29. }
  30. }
  31. // System.out.println(tmp);
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement