words.add(t.getWord());
}
}
public ArrayList<String> extractAspects(Review r) throws IOException
{
ParsedData parsedData = new ParsedData();
boolean skipReview = false;
// ArrayList<ArrayList<String>> cleanSentences = pr.process(r, dp.textpro);
do
{
Lexicons.reviewTargets.clear();
Lexicons.reviewOpinions.clear();
int sentenceNum = r.Review_Sentences.size();
try
{
for(int j =0; j < r.formatedSentences.size(); j++)
{
Formatted_Text sentence = r.formatedSentences.get(j);
ArrayList<DependencyRelation> depRelation = sentence.getTextDependencyRelations();
setWordsPos(sentence);
parsedData.setDependencyRelations(depRelation);
parsedData.setTaggedWords(posTags);
dp.setParsedData(parsedData);
dp.extractTargets(words);
posTags.clear();
words.clear();
}
updateDictionary();
for(int j =0; j < r.formatedSentences.size(); j++)
{
Formatted_Text sentence = r.formatedSentences.get(j);
ArrayList<DependencyRelation> depRelation = sentence.getTextDependencyRelations();
setWordsPos(sentence);
parsedData.setDependencyRelations(depRelation);
parsedData.setTaggedWords(posTags);
dp.setParsedData(parsedData);
dp.partWholeRel(words);
posTags.clear();
words.clear();
}
updateDictionary();
}
catch(Exception e)
{
skipReview = true;
continue;
}
Lexicons.reviewTargets.clear();
Lexicons.reviewOpinions.clear();
try
{
//ArrayList<ArrayList<String>> cleanSentences = pr.process(r, dp.textpro);
for(int j =0; j < r.formatedSentences.size(); j++)
{
Formatted_Text sentence = r.formatedSentences.get(j);
ArrayList<DependencyRelation> depRelation = sentence.getTextDependencyRelations();
setWordsPos(sentence);
parsedData.setDependencyRelations(depRelation);
parsedData.setTaggedWords(posTags);
dp.setParsedData(parsedData);
dp.expandLexicon(words);
posTags.clear();
words.clear();
}