Created
January 21, 2015 11:30
-
-
Save yukihir0/14d5b663c4f70f2398d6 to your computer and use it in GitHub Desktop.
本文抽出モジュールExtractContentのGolang版を作った。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "github.com/yukihir0/gec" | |
| "io/ioutil" | |
| ) | |
| func main() { | |
| src, err := ioutil.ReadFile("sample1.html") | |
| if err != nil { | |
| panic(err) | |
| } | |
| text := string(src) | |
| opt := gec.NewOption() | |
| opt.Threashold = 150 | |
| content, title := gec.Analyse(text, opt) | |
| fmt.Println("-----") | |
| fmt.Println(content) | |
| fmt.Println(title) | |
| fmt.Println("-----") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment