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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user