|
1 | 1 | import { once } from "es-toolkit"; |
2 | | -import { ensureTrailingSlash } from "@/util"; |
| 2 | +import { pathJoin } from "@/util"; |
3 | 3 | import type { ByLang } from "@/util.types"; |
4 | 4 |
|
5 | | -// TODO Remove? |
6 | | -export type AnnotationGroup = |
7 | | - | "saldo" |
8 | | - | "msd" |
9 | | - | "syntax" |
10 | | - | "readability" |
11 | | - | "wsd" |
12 | | - | "sensaldo" |
13 | | - | "lexicalClasses" |
14 | | - | "swener"; |
15 | | - |
16 | | -// TODO Remove? |
17 | | -export const baseAnalyses = [ |
18 | | - "sbx-swe-sentence-sparv-storsuc", |
19 | | - "sbx-swe-tokenization-sparv-betterword", |
20 | | -]; |
21 | | - |
22 | | -// TODO Remove? |
23 | | -export const analysisListing: Record<AnnotationGroup, string[]> = { |
24 | | - saldo: [ |
25 | | - "sbx-swe-compound-sparv-saldolemgram", |
26 | | - "sbx-swe-compound-sparv-saldowords", |
27 | | - "sbx-swe-lemgram-sparv-saldo", |
28 | | - "sbx-swe-lemmatization-sparv-saldo2", |
29 | | - ], |
30 | | - msd: [ |
31 | | - "sbx-swe-msd-stanza-stanzamorph-suc3", |
32 | | - "sbx-swe-msd-stanza-stanzamorph-ufeats", |
33 | | - "sbx-swe-pos-stanza-stanzamorph", |
34 | | - ], |
35 | | - syntax: ["sbx-swe-dependency-stanza-stanzasynt"], |
36 | | - readability: [ |
37 | | - "sbx-swe-readability-sparv-lix", |
38 | | - "sbx-swe-readability-sparv-nk", |
39 | | - "sbx-swe-readability-sparv-ovix", |
40 | | - ], |
41 | | - wsd: ["sbx-swe-sense-sparv"], |
42 | | - sensaldo: ["sbx-swe-sentiment-sparv-sensaldo"], |
43 | | - lexicalClasses: [ |
44 | | - "sbx-swe-lexical_classes_text-sparv-blingbring", |
45 | | - "sbx-swe-lexical_classes_text-sparv-swefn", |
46 | | - "sbx-swe-lexical_classes_token-sparv-blingbring", |
47 | | - "sbx-swe-lexical_classes_token-sparv-swefn", |
48 | | - ], |
49 | | - swener: ["sbx-swe-namedentity-swener", "sbx-swe-geotagcontext-sparv"], |
50 | | -}; |
51 | | - |
52 | 5 | export type AnalysisId = string; |
53 | 6 |
|
54 | 7 | /** Suggested annotation definitions for each known analysis id. */ |
@@ -103,13 +56,12 @@ export const annotationAnalyses: Readonly<Record<string, AnalysisId>> = |
103 | 56 | ), |
104 | 57 | ); |
105 | 58 |
|
106 | | -export const loadAnalysisMetdata = once(async () => { |
107 | | - const urlRaw = import.meta.env.VITE_METADATA_URL; |
108 | | - if (!urlRaw) throw new Error("Missing VITE_METADATA_URL"); |
109 | | - |
110 | | - const url = ensureTrailingSlash(urlRaw); |
| 59 | +export const loadAnalysisMetadata = once(async () => { |
| 60 | + const url = import.meta.env.VITE_METADATA_URL; |
| 61 | + if (!url) throw new Error("Missing VITE_METADATA_URL"); |
111 | 62 |
|
112 | | - const response = await fetch(url + "analyses"); |
| 63 | + console.log(pathJoin(url, "analyses")); |
| 64 | + const response = await fetch(pathJoin(url, "analyses")); |
113 | 65 | const data = (await response.json()) as AnalysisMetadataResponse; |
114 | 66 | return data.resources.filter( |
115 | 67 | (resource) => |
|
0 commit comments