Skip to content

Instantly share code, notes, and snippets.

@CliffordAnderson
Last active May 17, 2017 18:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CliffordAnderson/ccc08dae693660d7aa1b8cf2708fd13d to your computer and use it in GitHub Desktop.
Save CliffordAnderson/ccc08dae693660d7aa1b8cf2708fd13d to your computer and use it in GitHub Desktop.
xquery version "3.1";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
for $p in fn:collection("vwwp_tei")//tei:p
where $p contains text "garden" occurs at least 2 times
return $p
xquery version "3.1";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
for $p in fn:collection("vwwp_tei")//tei:p
where $p contains text { "house", "garden"} all
return $p
xquery version "3.1";
let $database := "vwwp_tei"
let $term := ("garden", "house")
let $options := map { "mode" : "all" }
return ft:search($database, $term, $options)
xquery version "3.1";
let $database := "vwwp_tei"
let $term := ("garden")
let $options := map { "fuzzy" : true() }
return ft:extract(ft:search($database, $term, $options))
xquery version "3.1";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
let $hits :=
for $hit in
ft:mark(
for $p in fn:collection("vwwp_tei")//text()
where $p contains text "garden" occurs at least 2 times
return $p
)
return
if ($hit instance of text()) then fn:normalize-space($hit)
else $hit
for tumbling window $w in $hits
start at $s when $s mod 6 = 1
return element hit {$w}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment