Package org.lionsoul.jcseg.extractor
Class KeyphraseExtractor
- java.lang.Object
-
- org.lionsoul.jcseg.extractor.KeyphraseExtractor
-
- Direct Known Subclasses:
TextRankKeyphraseExtractor
public abstract class KeyphraseExtractor extends Object
key phrase extractor- Author:
- chenxin
-
-
Constructor Summary
Constructors Constructor Description KeyphraseExtractor(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>getKeyphrase(Reader reader)get the keyphrase list from a readerList<String>getKeyphraseFromFile(String file)get the keyphrase list from a fileList<String>getKeyphraseFromString(String doc)get the keyphrase list from a stringISegmentgetSeg()voidsetSeg(ISegment seg)
-
-
-
Field Detail
-
seg
protected ISegment seg
the ISegment object
-
-
Constructor Detail
-
KeyphraseExtractor
public KeyphraseExtractor(ISegment seg)
construct method- Parameters:
seg-
-
-
Method Detail
-
filter
protected boolean filter(IWord word)
word item filter- Parameters:
word-- Returns:
- boolean
-
getKeyphraseFromString
public List<String> getKeyphraseFromString(String doc) throws IOException
get the keyphrase list from a string- Parameters:
doc-- Returns:
- List[]
- Throws:
IOException
-
getKeyphraseFromFile
public List<String> getKeyphraseFromFile(String file) throws IOException
get the keyphrase list from a file- Parameters:
file-- Returns:
- List[]
- Throws:
IOException
-
getKeyphrase
public abstract List<String> getKeyphrase(Reader reader) throws IOException
get the keyphrase list from a reader- Parameters:
reader-- Throws:
IOException
-
getSeg
public ISegment getSeg()
-
setSeg
public void setSeg(ISegment seg)
-
-