mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-26 03:14:19 +00:00
51 lines
1.4 KiB
Markdown
51 lines
1.4 KiB
Markdown
# Corpus Analysis
|
|
|
|
## Start einer Session
|
|
|
|
```javascript
|
|
nopaque.socket.emit("corpus_analysis_init", <corpusId>);
|
|
<corpusId> ~ number
|
|
// Show init loading modal
|
|
|
|
nopaque.socket.on("corpus_analysis_init", <response>);
|
|
<response> ~ {"code": <code>, "msg": <message>}
|
|
<code> ~ number // HTTP status code
|
|
<msg> ~ string
|
|
// Hide init loading modal
|
|
```
|
|
|
|
## Ausführen einer Suchanfrage
|
|
|
|
Ergebnisse werden Stückchenweise als "chunks" übertragen.
|
|
|
|
```javascript
|
|
nopaque.socket.emit("corpus_analysis_query", <query>);
|
|
<query> ~ string
|
|
// Clear result data store and list
|
|
result = {"query": <query>};
|
|
// Hide query result card
|
|
// Show query loading card
|
|
nopaque.socket.on("corpus_analysis_query", <response>);
|
|
<response>: {"code": <code>, "result": <result>}
|
|
<code> ~ number // Error, Success
|
|
<result> ~ {"matches": [<cpos>, ...],
|
|
"num_matches": <num_matches>,
|
|
"cpos_lookup": {<cpos>: <token>, ...},
|
|
"text_lookup": {<textId>: <text>, ...}}
|
|
<cpos> ~ number
|
|
<num_matches> ~ number
|
|
<token> ~ {"word": <word>, "lemma": <lemma>, "simple_pos": <simple_pos>, "pos": <pos>, "ner": <ner>, "text": <textId>, "s": <sId>}
|
|
<word> ~ string
|
|
<lemma> ~ string
|
|
<simple_pos> ~ string
|
|
<pos> ~ string
|
|
<ner> ~ string
|
|
<textId> ~ number
|
|
<sId> ~ number
|
|
<text> ~ {"author": <author>, "title": <text>, ...}
|
|
<s> ~ string
|
|
// Process response
|
|
// Hide query result card
|
|
// Show query loading card
|
|
```
|