예제 #1
0
파일: article.go 프로젝트: golibri/article
func summaryFromFulltext(str string) string {
	bag := tldr.New()
	result, err := bag.Summarize(str, 3)
	if err != nil {
		return ""
	}
	return result
}
예제 #2
0
func (story *Story) Summarize(sentences int) string {
	tldr := tldr.New()
	result, err := tldr.Summarize(story.Content, sentences)
	if err != nil {
		fmt.Printf("There was an error summarizing text:\n%s\n", err)
	}

	return result
}