xquery/nieuwe_namen.xq

This commit is contained in:
Peter Kleiweg
2026-04-08 20:24:52 +02:00
parent 913bb8079f
commit b05ff1a4a9
3 changed files with 33 additions and 0 deletions

1
.gitignore vendored
View File

@@ -32,3 +32,4 @@ bin/week2files
20??
corpus
data
tmp

12
xquery/howto Normal file
View File

@@ -0,0 +1,12 @@
alto *.data.dz tq:nieuwe_namen.xq | sort | uniq > items.txt
voor elk item dit bijwerken:
type Item struct {
count int
tags map[string]int
}
items := make(map[string]Item)

20
xquery/nieuwe_namen.xq Normal file
View File

@@ -0,0 +1,20 @@
for $x in //node[((@cat="mwu" and node[@pt="spec"]) or (@pt and @*="eigen" and not(@rel="mwp"))) and not(@his="normal") and not(@his_1="decap" or @his_1="0")]
return ( <i>
<m> {replace(data(/alpino_ds/sentence/@sentid), "\.[^.]*$", "")} </m>
{
for $i in data(/alpino_ds/metadata/meta[@name="cat"]/@value)
return <c> {$i} </c>
}
{
for $i in data(/alpino_ds/metadata/meta[@name="tag"]/@value)
return <t> {$i} </t>
}
<w> { data($x//@word) } </w>
</i>, '&#xa;' )
(:
<m>{ data(/alpino_ds/sentence/@sentid) }</m>
<m>{ replace(data(/alpino_ds/sentence/@sentid), "\.[^.]*$", "") }</m>
:)