Skip to content

Commit 72d203e

Browse files
committed
Experiment with stax
1 parent 8db72c9 commit 72d203e

43 files changed

Lines changed: 237 additions & 115 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

client/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta name="viewport" content="width=device-width,initial-scale=0.8">
88
<link rel="icon" href="/favicon.ico">
99
<link rel="stylesheet" href="/font-awesome/css/font-awesome.min.css">
10-
<script defer data-domain="portal.clarin.ivdnt.org/galahad" src="https://statistiek.ivdnt.org/js/script.js"></script>
10+
<script defer data-domain="galahad.ivdnt.org" src="https://statistiek.ivdnt.org/js/script.js"></script>
1111
<title>GaLAHaD</title>
1212
</head>
1313

client/src/components/input/FileFormatInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const options = [
2525
{ value: Format.Tsv, text: "TSV (Tab-separated values)" },
2626
]
2727
// Admins can also export txt.
28-
if (userStore.user.admin) {
28+
if (userStore.user.isAdmin) {
2929
// This exports the plain text, not the annotations.
3030
options.push({ value: Format.Txt, text: "TXT (Plain text)" })
3131
}

client/src/components/modals/corpus/CorpusForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</td>
4848
</tr>
4949

50-
<template v-if="userStore.user.admin">
50+
<template v-if="userStore.user.isAdmin">
5151
<tr>
5252
<td colspan="2">
5353
<hr>

client/src/components/tables/CorpusTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<template #prepend>
2828
<div style="display: flex; align-items: center; justify-content: center; margin-bottom:1em"
29-
v-if="userStore.user.admin || type != TableCorporaType.Dataset">
29+
v-if="userStore.user.isAdmin || type != TableCorporaType.Dataset">
3030
<GButton green @click="$emit('create')" v-if="type == TableCorporaType.User">
3131
New
3232
</GButton>

client/src/components/tables/DocumentsTable.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,14 @@
4444
{{ data.value }}
4545
</template>
4646

47-
<template #head-layerSummary>
48-
annotation
49-
</template>
5047
<!-- layerSummary cell -->
5148
<template #cell-layerSummary="data">
5249
<RightFloatCell>
5350
<template #left>
54-
{{ data.value.numTokens }}
51+
{{ data.value.tokens }}
5552
</template>
5653
<template #right>
57-
<InspectButton v-if="data.value.numTokens > 0"
54+
<InspectButton v-if="data.value.tokens > 0"
5855
@click="preview = data.value.layerPreview; previewDocument = data.item" />
5956
</template>
6057
</RightFloatCell>
@@ -144,7 +141,7 @@ const columns = computed<Field[]>(() => {
144141
{ key: "name", sortOn: (x: DocumentMetadata) => x.name, textAlign: "left" },
145142
{ key: "format", sortOn: (x: DocumentMetadata) => x.format },
146143
{ key: "preview", textAlign: "left" },
147-
{ key: "layerSummary" },
144+
{ key: "layerSummary", label: "tokens", sortOn: (x: DocumentMetadata) => x.layerSummary?.tokens },
148145
{ key: "lastModified", label: "last modified", sortOn: (x: DocumentMetadata) => x.lastModified }
149146
] as Field[];
150147
if (userStore.hasWriteAccess && props.type == TableDocumentsType.User) {

client/src/components/tables/LayerViewer.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ const columns = computed(() => {
2626
2727
const items = computed(() => {
2828
return props.layer?.terms.map((term) => {
29-
delete term.annotations["token"]
30-
term.annotations["token"] = term.targets.map(x => x.literal).join('_')
3129
return term.annotations
3230
})
3331
})

client/src/stores/documents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const documents = defineStore('documents', () => {
2828
// Fields
2929
const loading = ref(false)
3030
const available = ref([] as DocumentMetadata[])
31-
const numSourceAnnotations = computed(() => available.value.filter(i => i.layerSummary?.numTokens > 0).length)
31+
const numSourceAnnotations = computed(() => available.value.filter(i => i.layerSummary?.tokens > 0).length)
3232
const totalSizeInChars = computed(() => available.value.reduce((x, y) => x + y.numChars, 0))
3333
const uploading: Record<string, FileStatus> = reactive({})
3434
const uploadBusyCount = computed(() => Object.values(uploading).filter(i => i.status === "busy").length)

client/src/stores/evaluation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { UUID } from "@/types/corpora"
1111
// For some reason the terms are undefined sometimes
1212
// We handle it here
1313
export function literalsForTerm(term: Term): string {
14-
return term.targets.map(x => x.literal).join("..")
14+
return term.annotations["token"]
1515
}
1616

1717
export function literalsForTermComparison(termComparison: TermComparison): string {

client/src/stores/taggers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import { Tagger } from '@/types/taggers'
77
import * as API from '@/api/taggers'
88

99
/**
10-
* Sort the 'produces' field of the taggers. The order is stochastic when retrieved from the API.
10+
* Sort the 'annotations' field of the taggers. The order is stochastic when retrieved from the API.
1111
* For the interface, we want the order to be fixed.
1212
*/
13-
export function sort_tagger_produces(types: string[]): string[] {
13+
export function sort_tagger_annotations(types: string[]): string[] {
1414
// By pure coincidence, reverse sorting makes the order TOK, POS, LEM, which is acceptable.
1515
// But we might want a different order at some point.
1616
return types.sort((a, b) => b.localeCompare(a))

client/src/stores/user.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ const useUser = defineStore('user', () => {
1515
const corporaStore = stores.useCorpora() as CorporaStore
1616

1717
// Fields
18-
const user = ref({ id: 'NO USER', admin: false } as User)
18+
const user = ref({ id: 'NO USER', isAdmin: false } as User)
1919
const hasWriteAccess = computed((): boolean => {
20-
return corporaStore.userIsCollaborator || user.value.admin || corporaStore.activeCorpus?.owner === user.value.id
20+
return corporaStore.userIsCollaborator || user.value.isAdmin || corporaStore.activeCorpus?.owner === user.value.id
2121
})
2222
const hasDeleteAccess = computed((): boolean => {
2323
return canDelete(corporaStore.activeCorpus)
@@ -30,7 +30,7 @@ const useUser = defineStore('user', () => {
3030
*/
3131
function canDelete(corpus: CorpusMetadata | null): boolean {
3232
if (!corpus) return false
33-
return corpus.owner === user.value.id || user.value.admin
33+
return corpus.owner === user.value.id || user.value.isAdmin
3434
}
3535

3636
/**

0 commit comments

Comments
 (0)