Skip to content

Instantly share code, notes, and snippets.

@yukihir0
Created January 21, 2015 11:30
Show Gist options
  • Select an option

  • Save yukihir0/14d5b663c4f70f2398d6 to your computer and use it in GitHub Desktop.

Select an option

Save yukihir0/14d5b663c4f70f2398d6 to your computer and use it in GitHub Desktop.
本文抽出モジュールExtractContentのGolang版を作った。
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