Class SummaryExtractor

    • Field Detail

      • wordSeg

        protected ISegment wordSeg
        ISegment word tokenizer object
      • sentenceSeg

        protected SentenceSeg sentenceSeg
        sentence splitter object
    • Constructor Detail

      • SummaryExtractor

        public SummaryExtractor​(ISegment wordSeg,
                                SentenceSeg sentenceSeg)
        construct method
        Parameters:
        wordSeg -
        sentenceSeg -
    • Method Detail

      • getKeySentenceFromString

        public List<String> getKeySentenceFromString​(String doc)
                                              throws IOException
        get key sentence from a string
        Parameters:
        doc -
        Returns:
        List
        Throws:
        IOException
      • getKeySentenceFromFile

        public List<String> getKeySentenceFromFile​(String file)
                                            throws IOException
        get key sentence from a file path
        Parameters:
        file -
        Returns:
        List
        Throws:
        IOException
      • getKeySentence

        public abstract List<String> getKeySentence​(Reader reader)
                                             throws IOException
        get the key sentence from a reader
        Parameters:
        reader -
        Returns:
        String
        Throws:
        IOException
      • getSummaryFromString

        public String getSummaryFromString​(String doc,
                                           int length)
                                    throws IOException
        get document summary from a string
        Parameters:
        doc -
        length -
        Returns:
        String
        Throws:
        IOException
      • getSummaryFromFile

        public String getSummaryFromFile​(String file,
                                         int length)
                                  throws IOException
        get document summary from a file
        Parameters:
        file -
        length -
        Returns:
        String
        Throws:
        IOException
      • getSummary

        public abstract String getSummary​(Reader reader,
                                          int length)
                                   throws IOException
        get summary from a reader
        Parameters:
        reader -
        length -
        Returns:
        String
        Throws:
        IOException
      • getWordSeg

        public ISegment getWordSeg()
      • setWordSeg

        public void setWordSeg​(ISegment wordSeg)
      • setSentenceSeg

        public void setSentenceSeg​(SentenceSeg sentenceSeg)