Skip to content

Commit

Permalink
gs_index: v5
Browse files Browse the repository at this point in the history
  • Loading branch information
parkchamchi committed Oct 30, 2024
1 parent e656642 commit 4c4eaa3
Show file tree
Hide file tree
Showing 31 changed files with 722 additions and 652 deletions.
4 changes: 4 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Using XML.
</glossysnake-text>
```

Which can be transformed into JSON.
- ![/docs/design/images/class_serializable.png](/docs/design/images/class_serializable.png)
- `Paragraph` is an arbitary division that fits roughly a paper.

## Frontend data structure
- On `indexDB`, open DB `"corpusDBv5"`.
- Instead of locking the scroll, only load the mattering component.
2 changes: 1 addition & 1 deletion docs/design/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ e.g. `http://localhost/api/v2/annotator/annotate`
## Classes

### Serializable
![images/class_serializable.png](images/class_serializable.png)
![images/v4_class_serializable.png](images/v4_class_serializable.png)

- Reserved `Token.gloss`: `"!UNKNOWN"`

Expand Down
Binary file modified docs/design/images/class_serializable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 4 additions & 32 deletions docs/design/images/class_serializable.puml
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,21 @@
class Token <<serializable>> {
string txt
string gloss

bool is_delimiter
}

class Paragraph <<serializable>> {
string pstate

Token[] tokens
bool is_delimiter
char[] token_delimiters

<strike>string annotator_info</strike>
string original_text

AnnotatorInfo annotator_info_obj
}
Paragraph o-left- Token

class Corpus <<serializable>> {
Paragraph[] paragraphs
string[] paragraph_delimiters
int version = 5
Object metadata

string orignal_text
int[] p_div_locs
<strike>string[] task_ids</strike>
Paragraph[] paragraphs
}
Corpus o-left- Paragraph

enum pstate <<quasi>> ##[dashed] {
"PLAIN"
"DIVIDED"
"PARSED"
"ANNOTATED"
}
Paragraph *-- pstate
note right of pstate::"ANNOTATED"
default fallback
end note

class AnnotatorInfo <<serializable>> {
string annotator_name
string lang_from
string lang_to
}
Paragraph *-- AnnotatorInfo

@enduml
Binary file added docs/design/images/v4_class_serializable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions docs/design/images/v4_class_serializable.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
@startuml

class Token <<serializable>> {
string txt
string gloss
bool is_delimiter
}

class Paragraph <<serializable>> {
string pstate

Token[] tokens
bool is_delimiter
char[] token_delimiters

<strike>string annotator_info</strike>
string original_text

AnnotatorInfo annotator_info_obj
}
Paragraph o-left- Token

class Corpus <<serializable>> {
Paragraph[] paragraphs
string[] paragraph_delimiters

string orignal_text
int[] p_div_locs
<strike>string[] task_ids</strike>
}
Corpus o-left- Paragraph

enum pstate <<quasi>> ##[dashed] {
"PLAIN"
"DIVIDED"
"PARSED"
"ANNOTATED"
}
Paragraph *-- pstate
note right of pstate::"ANNOTATED"
default fallback
end note

class AnnotatorInfo <<serializable>> {
string annotator_name
string lang_from
string lang_to
}
Paragraph *-- AnnotatorInfo

@enduml
84 changes: 50 additions & 34 deletions src/backend/gs_index/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,51 +1,67 @@
<script>
import Header from "./components/Header.vue"
import RestAuth from "./components/RestAuth.vue"
import AnnotatorSelect from "./components/AnnotatorSelect.vue"
import LocalAnnotatorOptions from "./components/LocalAnnotatorOptions.vue"
import MiscOptions from "./components/MiscOptions.vue"
import CorpusesView from "./components/CorpusesView.vue"
import UploadView from "./components/UploadView.vue"
import AlertsView from "./components/AlertsView.vue"
import TasksView from "./components/TasksView.vue"
import Header from "./components/Header.vue";
import AnnotatorSelect from "./components/AnnotatorSelect.vue";
import LocalAnnotatorOptions from "./components/LocalAnnotatorOptions.vue";
import MiscOptions from "./components/MiscOptions.vue";
import CorpusesView from "./components/CorpusesView.vue";
import UploadView from "./components/UploadView.vue";
import Corpus from "./components/Corpus.vue";
import { EventBus } from "./EventBus.js";
import { sharedState } from "./sharedState.js";
export default {
components: {
Header, RestAuth, AnnotatorSelect,
LocalAnnotatorOptions, MiscOptions,
CorpusesView, UploadView, AlertsView,
TasksView,
Header, CorpusesView, AnnotatorSelect, LocalAnnotatorOptions, MiscOptions,
UploadView,
Corpus,
},
data() {
return {
}
},
computed: {
currentOpenCorpus() {
return sharedState.currentOpenCorpus;
}
},
methods: {
},
mounted() {
//EventBus.on("openCorpus", this.openCorpus);
//EventBus.on("closeCorpus", this.closeCorpus);
},
beforeDestroy() {
//EventBus.off("openCorpus", this.openCorpus);
//EventBus.off("closeCorpus", this.closeCorpus);
},
}
</script>

<template>
<header>
<Header />
</header>

<main>
<RestAuth />
<hr>
<AnnotatorSelect />
<hr>
<LocalAnnotatorOptions />
<hr>
<MiscOptions />
<hr>
<CorpusesView />
<hr>
<UploadView />
<hr>
<AlertsView />
<hr>
<TasksView />
</main>
<div v-if="currentOpenCorpus">
<Corpus :corpusId="currentOpenCorpus" />
</div>
<div v-else>
<header>
<Header />
</header>

<main>
<AnnotatorSelect />
<LocalAnnotatorOptions />
<MiscOptions />
<hr>

<CorpusesView />
<hr>

<UploadView />
</main>
</div>
</template>

<style scoped>
Expand Down
13 changes: 0 additions & 13 deletions src/backend/gs_index/src/components/AnnotatorSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,12 @@
lang_to() {
this.emitChange();
},
toRemote() {
this.emitChange();
},
},
methods: {
emitChange() {
sharedState.annotator_name = this.annotator_name;
sharedState.lang_from = this.lang_from;
sharedState.lang_to = this.lang_to;
sharedState.toRemote = this.toRemote;
},
}
}
Expand Down Expand Up @@ -64,11 +58,4 @@
</div>

<br>

<div>
<input v-model="toRemote"
type="checkbox" name="toRemote" id="toRemote_input" class="form-check-input"
checked>
<label for="toRemote_input" class="form-check-label">To the remote server</label>
</div>
</template>
Loading

0 comments on commit 4c4eaa3

Please sign in to comment.