Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a for loop,after each iteration am storing my corresponding values in the array.Now i want to display the entire array values in a single JOption Pane.How is it possible ?


Here is my code :-



MaxentTagger tagger = new MaxentTagger("src/taggers/left3words-wsj-0-18.tagger");
System.out.println(question);
String sample = question.replaceAll("\\W", " ");
System.out.println("\n");
System.out.println(sample);
String tagged = tagger.tagTokenizedString(sample);
System.out.println(tagged);
String[] tokens = tagged.split(" ");
ArrayList<string> list = new ArrayList<string>();
for(int i=0;i<tokens.length;i++)>
{
if (tokens[i].substring(tokens[i].lastIndexOf("_")+1).startsWith("N"))
{
list.add(tokens[i].split("_")[0]);
}
}
noun=list.get(0);
System.out.println("First Noun="+noun);
for( j=0;j<=11;j++)
{
s=nodeNumeric[j].toString();
// System.out.println(s);
double similarity=compute(s,noun);
//System.out.println(similarity);
if(similarity>.8)
{
A[j]=s;
System.out.println(A[j]);
//System.out.println(a);
//continue;
JOptionPane.showMessageDialog(frame,"Question Asked :- " + question + "\n\n Class:- "+A[j]+"");
//break;
}

}

}
public double compute(String valueNumeric, String noun) {
WS4JConfiguration.getInstance().setMFS(true);
double s = new WuPalmer(db).calcRelatednessOfWords(valueNumeric,noun);
return s;
}
Posted
Updated 16-Feb-15 22:56pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900