Open fishfree opened 5 months ago
BlackLab supports collocation, but we don't show it in the ui (yet): https://inl.github.io/BlackLab/server/rest-api/corpus/hits/get.html#:~:text=specify%20the%20value-,colloc,-to%20calculate%20collocations
If you create the query manually, it should be fairly easy to get collocations in a script. I'll have a look if we can expose this in the interface.
corpusId = 'my_corpus'
fetch(`http://localhost:8080/blacklab-server/${corpusId}/hits?` + new URLSearchParams({
patt: '"word"',
calc: 'colloc',
wordsaroundhit: 10
}).toString(), {
headers: {
'Accept': 'application/json' }
}
)
.then(r => r.json())
.then(console.log)
Collocation is usually a necessary feature of corpus management system. Maybe I should post in the BlackLab backend repo. Does BlackLab backend provide the correspondent method and HTTP API?