private void CYK(){
		int m=words.length;
		for(int j=0;j<m;j++){
			chart[j][j]=findLR(words[j],j,j);
			chart[j][j].updateBeta(0, j, j);
			//chart[j][j].printDebug();
			//calculate:Alpha and Beta
			for(int i=j-1;i>=0;i--){
				//System.out.println("i="+i+"   j="+j);
				chart[i][j]=new Chart(i,j);
				for(int k=i;k<j;k++){
					Iterator<SyntacticRule> iter=srules.keySet().iterator();
					while(iter.hasNext()){
						SyntacticRule sr=iter.next();
						if(sr.r1.equals(chart[i][k].s) && sr.r2.equals(chart[k+1][j].s)){
							double psr=srules.get(sr);
							if(psr*chart[i][k].p*chart[k+1][j].p>chart[i][j].p){//find a better parse,update
								chart[i][j].s=sr.l;
								chart[i][j].p=psr*chart[i][k].p*chart[k+1][j].p;
								chart[i][j].lC=chart[i][k];
								chart[i][j].rC=chart[k+1][j];
							}
							chart[i][j].updateBeta(psr, i, j);
							//chart[i][j].printDebug();
						}
					}
									
					//for(every A->BC){
					//	if(B in chart[i][k] && C in chart[k+1][j]){
					//		chart[i][j].add(A);
					//		calculate:Alpha and Beta
					//	}//end if
					//}//end for
				}//end for
			}//end for
		}//end for
	}//end void