Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoertl committed Oct 25, 2023
1 parent 579d904 commit b3e8494
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/composables/useMediaSourceSearch.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// this file incoperates the actual search for the yearly frequency data

export function useMediaSourceSearch() {
const { FREQUENCIES_URL } = useAPIs();
// const { FREQUENCIES_URL } = useAPIs();

const { authenticatedFetch } = useAuthenticatedFetch();
// todo storeToRefs as soon this data is actually fetched
const { corpusStatistics } = useCorporaStore();
// const { authenticatedFetch } = useAuthenticatedFetch();
// // todo storeToRefs as soon this data is actually fetched
// const { corpusStatistics } = useCorporaStore();
// const { getWordlist } = useWordlist();
const getMediaSourceFrequencies = async (query: CorpusQuery) => {
// todo implement proper mapping and returning of ifos
Expand Down
7 changes: 2 additions & 5 deletions src/composables/useYearlyFrequenciesSearch.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// this file incoperates the actual search for the yearly frequency data
import { type Ref } from "vue"

import { useCorporaStore } from "../stores/corpora";
import { useCorporaStore, type usedYear } from "../stores/corpora";

export function useYearlyFrequenciesSearch() {
const { FREQUENCIES_URL } = useAPIs();
Expand Down Expand Up @@ -32,8 +30,7 @@ export function useYearlyFrequenciesSearch() {
query.data.yearlyFrequencies.push({
year: Number(year),
absolute: freq,
// @ts-ignore
relative: freq / corpusStatistics.avgYearlyFrequencies[Number(year)],
relative: freq / corpusStatistics.avgYearlyFrequencies[Number(year) as unknown as usedYear],
});
});
query.loading.yearlyFrequencies = false;
Expand Down
22 changes: 21 additions & 1 deletion src/stores/corpora.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@ import { computed, type Ref, ref, watch } from "vue";

import { useAuthenticatedFetch } from "../composables/useAuthenticatedFetch";

export type usedYear = 2005 |
2006 |
2007 |
2008 |
2009 |
2010 |
2012 |
2013 |
2014 |
2015 |
2016 |
2017 |
2018 |
2019 |
2020 |
2021 |
2022;

export const useCorporaStore = defineStore(
"corpora",
() => {
Expand Down Expand Up @@ -33,6 +51,8 @@ export const useCorporaStore = defineStore(
const subCorpora: Ref<Array<SubCorpus>> = ref([]);
const selectedSubCorpus: Ref<SubCorpus | null> = ref(null);



const corpusStatistics = ref({
// todo fetch this data from server
totalAverageFrequency: 30,
Expand All @@ -55,7 +75,7 @@ export const useCorporaStore = defineStore(
2020: 5,
2021: 5,
2022: 5,
},
} as Record<usedYear, number>,
});

const { SUB_CORPUS_URL } = useAPIs();
Expand Down

0 comments on commit b3e8494

Please sign in to comment.