Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Collocation #473

Open
fishfree opened this issue Mar 29, 2024 · 1 comment
Open

Feature request: Collocation #473

fishfree opened this issue Mar 29, 2024 · 1 comment
Labels

Comments

@fishfree
Copy link

fishfree commented Mar 29, 2024

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?

@KCMertens
Copy link
Member

KCMertens commented Mar 29, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants