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

@@ -13,4 +13,5 @@ public interface HeadlineDao {
Headline select(int id);
List<Headline> select(String stock, Date date);
List<Headline> select(String stock, Date startDate, Date endDate);
}

View File

@@ -24,7 +24,8 @@ public class HeadlineDaoImpl implements HeadlineDao {
private static final String SELECT_BY_ID_QRY = "SELECT * from headlines WHERE id = ?";
private static final String SELECT_BY_STOCK_QRY = "SELECT * from headlines WHERE stock = ? AND date = ?";
private static final String SELECT_BY_DATE_RANGE_QRY = "SELECT * from headlines WHERE stock = ? AND date >= ? AND date <= ?";
private JdbcTemplate jdbcTemplate;
public int deleteById(int headlineId) {
@@ -66,6 +67,11 @@ public class HeadlineDaoImpl implements HeadlineDao {
new RequestMapper(), stock, date);
}
public List<Headline> select(String stock, Date startDate, Date endDate) {
return jdbcTemplate.query(SELECT_BY_DATE_RANGE_QRY,
new RequestMapper(), stock, startDate, endDate);
}
@Autowired
public void createTemplate(DataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);