Skip to content

Commit

Permalink
fixes wordform frequencies for #8
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoertl committed Jan 2, 2024
1 parent ccf0d09 commit a5c4af6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/composables/useMediaSourceSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,22 @@ export function useMediaSourceSearch() {
//q: `${query.preparedQuery};${corpora.corporaForSearch};fttattr=doc.docsrc;fcrit=doc.id;flimit=0;format=json`,
},
});
if (!mediaSources?.value || mediaSources?.value.Blocks) {
query.loading.mediaSources = false;
return console.error("error on MediaSources");
}
// // @ts-ignore
// if (!mediaSources?.value || !mediaSources?.value.Blocks) {
// query.loading.mediaSources = false;
// return console.error("error on MediaSources");
// }
const mediaSourceData = mediaSources.value as FreqMLDocsRC;

console.log({
mediaSourceData,
blocks: mediaSourceData.Blocks,
// @ts-ignore
items: mediaSourceData.Blocks[0].Items,
items: mediaSourceData.Blocks[0]?.Items,
});

// @ts-ignore
const WordformData = mediaSourceData.Blocks[0].Items;
const WordformData = (mediaSourceData.Blocks || [])[0]?.Items ?? [];
WordformData.forEach(({ frq, Word, fpm }) => {
query.data.mediaSources.push({
// @ts-ignore
Expand Down

0 comments on commit a5c4af6

Please sign in to comment.