Package it.unipd.dei.eis.data.sources
Class TermsDataSource
- java.lang.Object
-
- it.unipd.dei.eis.data.sources.DataSource<TermsDataEntity,Map<String,Integer>>
-
- it.unipd.dei.eis.data.sources.TermsDataSource
-
public class TermsDataSource extends DataSource<TermsDataEntity,Map<String,Integer>>
TermsDataSource is the data source for the terms. It contains the data structure of the terms.
-
-
Field Summary
Fields Modifier and Type Field Description static StringIDThe ID of the data source.private static PatternPATTERNThe PATTERN is used to check if a word is a punctuation or other special symbols.private List<String>stoplistThe stoplist field is used to store the stoplist.private static StringSTOPLIST_FILE_NAMEThe STOPLIST_FILE_NAME field is used to store the name of the file containing the stoplist.-
Fields inherited from class it.unipd.dei.eis.data.sources.DataSource
decoder, encoder, id
-
-
Constructor Summary
Constructors Constructor Description TermsDataSource()TermsDataSource constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private List<String>getStoplist()The getStoplist method is used to get the stoplist from the file.(package private) voidsetData(Context context, List<TermsDataEntity> entities)The set method is used to set the data source.-
Methods inherited from class it.unipd.dei.eis.data.sources.DataSource
get, getData, set
-
-
-
-
Field Detail
-
ID
public static final String ID
The ID of the data source.- See Also:
- Constant Field Values
-
PATTERN
private static final Pattern PATTERN
The PATTERN is used to check if a word is a punctuation or other special symbols.
-
STOPLIST_FILE_NAME
private static final String STOPLIST_FILE_NAME
The STOPLIST_FILE_NAME field is used to store the name of the file containing the stoplist.- See Also:
- Constant Field Values
-
-
Method Detail
-
getStoplist
private List<String> getStoplist()
The getStoplist method is used to get the stoplist from the file.- Returns:
- the stoplist as a list of strings or an empty list if an error occurs
-
setData
void setData(Context context, List<TermsDataEntity> entities) throws Exception
The set method is used to set the data source. It is used to process the text and count the frequency of the terms. Multi threading is used to speed up the process.- Overrides:
setDatain classDataSource<TermsDataEntity,Map<String,Integer>>- Parameters:
context- the contextentities- the list of entities- Throws:
Exception- if an error occurs
-
-