, I'm comparing one arrayList with another arrayList, if elements that are "contained" in both i would like to attach the element in the second arraylist to the element in the first along with "== neg==". The problem is I'm creating a new element in the first Arraylist instead of appending it to the element. I'm new to programming any assistance would be appreciated!!
public static List<String> neg_compare( List<String>tagged, List<String>negative_words, List<String>total_compare )
{
//int pos_sentiment = 0;
//int pos_count = 0;
int total_tweets = 0;
int neg_count = 0;
for(int j =0 ; j < tagged.size(); j++)
{
total_tweets ++;
total_compare.add(tagged.get(j));
for(int k = 0; k < negative_words.size(); k++)
{
if(tagged.get(j).contains(negative_words.get(k)))
{
//pos_count ++;
total_compare.add( " == neg == " + negative_words.get(k) +"\n");
}
}
System.out.print(total_compare + "\n");
System.out.print(total_tweets);
}
return total_compare;
}
}