Skip to content

Commit

Permalink
feat: cattr dynamic for collocations
Browse files Browse the repository at this point in the history
  • Loading branch information
ctot-nondef committed Oct 16, 2024
1 parent 0bcb94a commit 2bf80ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/DataDisplay/DataDisplayCollocations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const api = useApiClient();
type Mode = "coll_freq" | "freq";
const mode: Ref<Mode> = ref("coll_freq");
const cattr: Ref<string> = ref("lemma");
const expand = ref(false);
// const collocations: Ref<Array<Array<ICollocations>>> = ref([]);
Expand Down Expand Up @@ -41,6 +42,7 @@ const q = computed(() =>
query.corpus,
query.subCorpus,
query.id,
cattr.value,
cbgrfns,
"joooooo",
JSON.stringify(queryStore.getQueryWithFacetting(query)),
Expand All @@ -50,7 +52,7 @@ const q = computed(() =>
const response = await api.search.getCollx({
corpname: query.corpus,
usesubcorp: query.subCorpus,
cattr: "lemma",
cattr: cattr.value,
ctow: 3,
cminfreq: 9,
cminbgr: 9,
Expand Down Expand Up @@ -176,7 +178,13 @@ function pointFormatter() {
</VBtn>
<VBtn value="freq" variant="outlined">{{ t("freq") }}</VBtn>
</VBtnToggle>

<VSelect
v-model="cattr"
item-title="cattr"
:items="['lemma', 'word', 'lempos']"
:label="t('cattr')"
style="flex-grow: 0; min-width: 15rem"
></VSelect>
<div v-for="(query, index) of queries" :key="query.id">
<QueryDisplay :loading="collocationsLoading[index]" :query="query" />
<HighCharts
Expand Down
1 change: 1 addition & 0 deletions src/types/query.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ interface CorpusQuery {
corpus: string;
subCorpus: string;
concordance_query: ConcordanceQuery;
cattr?: string;
KWICAttrsStructs: KWICAttrsStructs;
KWICAdditionalViewHeaders: Array<string>;
KWICAttrsStructsOptions: KWICAttrsStructsOptions; // ToDo: this might be refactored to come via requesat whenever needed.
Expand Down

0 comments on commit 2bf80ef

Please sign in to comment.