cats en tags
This commit is contained in:
@@ -211,11 +211,11 @@ func doArticle(filename string, url string, timestamp time.Time, needUpdate bool
|
||||
return false
|
||||
}
|
||||
|
||||
cats := make([]string, 0)
|
||||
tags := make([]string, 0)
|
||||
var buffer bytes.Buffer
|
||||
for _, i := range doc.Graph {
|
||||
p(buffer.WriteString(html.UnescapeString(i.ArticleBody)))
|
||||
cats = append(cats, i.ArticleSection...)
|
||||
tags = append(tags, i.ArticleSection...)
|
||||
}
|
||||
text := buffer.String()
|
||||
|
||||
@@ -245,11 +245,11 @@ func doArticle(filename string, url string, timestamp time.Time, needUpdate bool
|
||||
|
||||
fp, err := os.Create(filename + ".txt")
|
||||
p(err)
|
||||
if len(cats) == 0 {
|
||||
p(fmt.Fprintln(fp, "##META text cat ="))
|
||||
if len(tags) == 0 {
|
||||
p(fmt.Fprintln(fp, "##META text tag ="))
|
||||
} else {
|
||||
for _, cat := range cats {
|
||||
p(fmt.Fprintf(fp, "##META text cat = %s\n", fixSpace(cat)))
|
||||
for _, tag := range tags {
|
||||
p(fmt.Fprintf(fp, "##META text tag = %s\n", fixSpace(tag)))
|
||||
}
|
||||
}
|
||||
p(fp.WriteString(text))
|
||||
|
||||
@@ -56,6 +56,9 @@ Alpino -flag treebank xml debug=1 end_hook=xml user_max=900000 -parse < $corpus.
|
||||
cd xml
|
||||
alto -o $corpus.data.dz *.xml 2> /dev/null
|
||||
|
||||
# telling per bericht, niet per zin
|
||||
/net/corpora/nlnieuws/namen.sh -x 10 -s $corpus.data.dz > $corpus.tag.txt
|
||||
|
||||
cd ../..
|
||||
rm -fr out
|
||||
|
||||
|
||||
Reference in New Issue
Block a user