Added ability to generate 1, 2, 3-gram models on a company/date-range basis using <UNK> to represent the initial appearance of a previously unknown word.

This commit is contained in:
Woody Folsom
2012-04-16 14:03:16 -04:00
parent 027adff2dd
commit eec32b19c1
10 changed files with 625 additions and 1 deletions

View File

@@ -9,4 +9,5 @@ public interface HeadlineService {
int insertHeadline(Headline headline);
int[] insertHeadlines(List<Headline> headline);
List<Headline> getHeadlines(String stock, Date date);
List<Headline> getHeadlines(String stock, Date startDate, Date endDate);
}

View File

@@ -32,4 +32,9 @@ public class MySQLHeadlineServiceImpl implements HeadlineService {
public List<Headline> getHeadlines(String stock, Date date) {
return headlineDao.select(stock, date);
}
@Override
public List<Headline> getHeadlines(String stock, Date startDate, Date endDate) {
return headlineDao.select(stock, startDate, endDate);
}
}

View File

@@ -86,4 +86,10 @@ public class YahooHeadlineServiceImpl implements HeadlineService {
String formattedDate = DATE_FORMATTER.format(date);
return QUERY_URL.replaceAll(STOCK_SYMBOL_FIELD, stock).replaceAll(STORY_DATE_FIELD, formattedDate);
}
@Override
public List<Headline> getHeadlines(String stock, Date startDate,
Date endDate) {
throw new UnsupportedOperationException("This implementation does not support getting headlines for a date range.");
}
}