Package org.lionsoul.jcseg.extractor
Class KeywordsExtractor
- java.lang.Object
-
- org.lionsoul.jcseg.extractor.KeywordsExtractor
-
- Direct Known Subclasses:
TextRankKeywordsExtractor
public abstract class KeywordsExtractor extends Object
document keywords extractor- Author:
- chenxin
-
-
Constructor Summary
Constructors Constructor Description KeywordsExtractor(ISegment seg)construct method
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleanfilter(IWord word)word item filterabstract List<String>getKeywords(Reader reader)get the keywords list from a readerList<String>getKeywordsFromFile(String file)get the keywords list from a fileList<String>getKeywordsFromString(String doc)get the keywords list from a stringISegmentgetSeg()voidsetSeg(ISegment seg)
-
-
-
Field Detail
-
seg
protected ISegment seg
the ISegment object
-
-
Constructor Detail
-
KeywordsExtractor
public KeywordsExtractor(ISegment seg)
construct method- Parameters:
seg-
-
-
Method Detail
-
filter
protected boolean filter(IWord word)
word item filter- Parameters:
word-
-
getKeywordsFromString
public List<String> getKeywordsFromString(String doc) throws IOException
get the keywords list from a string- Parameters:
doc-- Returns:
- List[]
- Throws:
IOException
-
getKeywordsFromFile
public List<String> getKeywordsFromFile(String file) throws IOException
get the keywords list from a file- Parameters:
file-- Returns:
- List[]
- Throws:
IOException
-
getKeywords
public abstract List<String> getKeywords(Reader reader) throws IOException
get the keywords list from a reader- Parameters:
reader-- Throws:
IOException
-
getSeg
public ISegment getSeg()
-
setSeg
public void setSeg(ISegment seg)
-
-