Skip to content

Instantly share code, notes, and snippets.

@yssymmt
Created September 19, 2022 16:46
Show Gist options
  • Save yssymmt/92464d994724482e0ef8690dc4fd1c1d to your computer and use it in GitHub Desktop.
Save yssymmt/92464d994724482e0ef8690dc4fd1c1d to your computer and use it in GitHub Desktop.
select
n1,
n2,
count(*) as cnt
from npath (
on (
select
docid,
seqno,
norm
from jumbo.aud06_mecab_vertical
where pos not in ('記号','助詞','助動詞')
and not (pos='名詞' and word in ('他','ん','よう','の','.','!」'))
and not (pos='動詞' and word in ('いる','し','さ','いる','れ','する','せ') )
)
partition by docid
order by seqno
using
mode (overlapping)
symbols (true as A)
pattern ('A.A')
result (
first(docid of A) as docid,
first(norm of A) as n1,
last(norm of A) as n2
)
) a1
group by 1,2
order by 3 desc
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment