Commit 29dbbd0a authored by Konstantin Schulz's avatar Konstantin Schulz
Browse files

added the PROIEL treebank texts to the corpus and fixed a small bug in the...

added the PROIEL treebank texts to the corpus and fixed a small bug in the citation system (now uses values instead of labels)
parent 84b67797
{
"name": "mcClient",
"version": "0.3.4",
"version": "0.3.5",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
......
......@@ -19,5 +19,6 @@
"perseidsCTSapiGetCapabilities": "GetCapabilities",
"perseidsCTSapiGetValidReff": "GetValidReff",
"perseidsCTSapiUrnSnippet": "&urn=",
"proielProjectUrl": "https://proiel.github.io/",
"vivaURN": "urn:custom:latinLit:viva.lat"
}
......@@ -101,10 +101,12 @@
"PHENOMENON_LEMMA": "Lemma",
"PHENOMENON_PART_OF_SPEECH": "Wortart",
"PREVIEW": "Vorschau",
"PROIEL_PROJECT": "PROIEL Treebank",
"QUERY_PHENOMENON": "Phänomen",
"QUERY_VALUE": "Suche",
"QUERY_VALUE_EMPTY": "Keine Suchanfrage ausgewählt",
"SELECTION_CONFIRM": "Auswahl bestätigen",
"SOFTWARE_DEPENDENCIES": "Software-Abhängigkeiten",
"SOLUTIONS_SHUFFLE": "Mischen",
"START": "Anfang",
"TEST": "Test",
......
......@@ -101,10 +101,12 @@
"PHENOMENON_LEMMA": "Lemma",
"PHENOMENON_PART_OF_SPEECH": "Part of speech",
"PREVIEW": "Preview",
"PROIEL_PROJECT": "PROIEL Treebank",
"QUERY_PHENOMENON": "Phenomenon",
"QUERY_VALUE": "Search",
"QUERY_VALUE_EMPTY": "Query value is empty",
"SELECTION_CONFIRM": "Confirm selection",
"SOFTWARE_DEPENDENCIES": "Software Dependencies",
"SOLUTIONS_SHUFFLE": "Shuffle",
"START": "Start",
"TEST": "Test",
......
......@@ -22,14 +22,14 @@
</ion-row>
<ion-row>
<ion-col>
<button large ion-button (click)="openUrl(callidusProjectUrl)">
<button large ion-button (click)="openUrl(HelperProvider.config['callidusProjectUrl'])">
{{ 'CALLIDUS_PROJECT' | translate }}
</button>
<button large ion-button (click)="openUrl(machinaCallidaFrontendUrl)">{{ 'MACHINA_CALLIDA_FRONTEND' |
translate }}
<button large ion-button (click)="openUrl(HelperProvider.config['machinaCallidaFrontendUrl'])">
{{ 'MACHINA_CALLIDA_FRONTEND' | translate }}
</button>
<button large ion-button (click)="openUrl(machinaCallidaBackendUrl)">{{ 'MACHINA_CALLIDA_BACKEND' |
translate }}
<button large ion-button (click)="openUrl(HelperProvider.config['machinaCallidaBackendUrl'])">
{{ 'MACHINA_CALLIDA_BACKEND' | translate }}
</button>
</ion-col>
</ion-row>
......@@ -40,8 +40,18 @@
</ion-row>
<ion-row>
<ion-col>
<a ion-button large href="{{developerMailTo}}">{{ 'EMAIL' | translate }}</a>
<a ion-button large href="{{HelperProvider.config['developerMailTo']}}">{{ 'EMAIL' | translate }}</a>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
{{ 'SOFTWARE_DEPENDENCIES' | translate }}
</ion-col>
</ion-row>
<ion-row>
<button large ion-button (click)="openUrl(HelperProvider.config['proielProjectUrl'])">
{{ 'PROIEL_PROJECT' | translate }}
</button>
</ion-row>
</ion-grid>
</ion-content>
......@@ -15,10 +15,7 @@ import {HelperProvider} from "../../providers/helper/helper";
templateUrl: 'feedback.html',
})
export class FeedbackPage {
public machinaCallidaFrontendUrl: string = HelperProvider.config["machinaCallidaFrontendUrl"];
public machinaCallidaBackendUrl: string = HelperProvider.config["machinaCallidaBackendUrl"];
public callidusProjectUrl: string = HelperProvider.config["callidusProjectUrl"];
public developerMailTo: string = HelperProvider.config["developerMailTo"];
HelperProvider = HelperProvider;
constructor(public navCtrl: NavController, public navParams: NavParams) {
}
......
......@@ -85,8 +85,8 @@ export class TextRangePage {
});
}
private addReferences(targetCitationLevel: string, relevantCitationLabels: string[] = []) {
let urnLastPart: string = relevantCitationLabels.map(x => x.toString()).join(".");
private addReferences(targetCitationLevel: string, relevantCitations: Citation[] = []) {
let urnLastPart: string = relevantCitations.map(x => x.value.toString()).join(".");
let fullUrn: string = this.corpusProvider.currentCorpus.source_urn + (urnLastPart ? ":" + urnLastPart : "");
return new Promise(resolve => {
this.corpusProvider.getCTSvalidReff(fullUrn).subscribe((result: string[] | object) => {
......@@ -110,19 +110,19 @@ export class TextRangePage {
}
newCitations.forEach((citation) => {
citation.subcitations = {};
if (relevantCitationLabels.length === 0) {
if (relevantCitations.length === 0) {
this.corpusProvider.currentCorpus.citations[citation.label] = citation;
this.currentlyAvailableCitations.push(citation.label);
}
else if (relevantCitationLabels.length === 1) {
this.corpusProvider.currentCorpus.citations[relevantCitationLabels[0]].subcitations[citation.label] = citation;
let firstLabel: string = this.corpusProvider.currentCorpus.citations[relevantCitationLabels[0]].label;
else if (relevantCitations.length === 1) {
this.corpusProvider.currentCorpus.citations[relevantCitations[0].label].subcitations[citation.label] = citation;
let firstLabel: string = this.corpusProvider.currentCorpus.citations[relevantCitations[0].label].label;
this.currentlyAvailableCitations.push(firstLabel.concat(".", citation.label));
}
else if (relevantCitationLabels.length === 2) {
this.corpusProvider.currentCorpus.citations[relevantCitationLabels[0]].subcitations[relevantCitationLabels[1]].subcitations[citation.label] = citation;
let firstLabel: string = this.corpusProvider.currentCorpus.citations[relevantCitationLabels[0]].label;
let secondLabel: string = this.corpusProvider.currentCorpus.citations[relevantCitationLabels[0]].subcitations[relevantCitationLabels[1]].label;
else if (relevantCitations.length === 2) {
this.corpusProvider.currentCorpus.citations[relevantCitations[0].label].subcitations[relevantCitations[1].label].subcitations[citation.label] = citation;
let firstLabel: string = this.corpusProvider.currentCorpus.citations[relevantCitations[0].label].label;
let secondLabel: string = this.corpusProvider.currentCorpus.citations[relevantCitations[0].label].subcitations[relevantCitations[1].label].label;
this.currentlyAvailableCitations.push(firstLabel.concat(".", secondLabel, ".", citation.label));
}
resolve();
......@@ -210,7 +210,7 @@ export class TextRangePage {
}
else if (index === 1) {
if (Object.keys(this.corpusProvider.currentCorpus.citations[citationLabels[index - 1]].subcitations).length === 0) {
this.addReferences(this.corpusProvider.currentCorpus.citation_level_2, [citationLabels[index - 1]]).then(() => {
this.addReferences(this.corpusProvider.currentCorpus.citation_level_2, [this.corpusProvider.currentCorpus.citations[citationLabels[index - 1]]]).then(() => {
valueList.push(this.corpusProvider.currentCorpus.citations[citationLabels[index - 1]].subcitations[label].value);
resolve();
});
......@@ -222,7 +222,7 @@ export class TextRangePage {
}
else if (index === 2) {
if (Object.keys(this.corpusProvider.currentCorpus.citations[citationLabels[index - 2]].subcitations[citationLabels[index - 1]].subcitations).length === 0) {
this.addReferences(this.corpusProvider.currentCorpus.citation_level_3, [citationLabels[index - 2], citationLabels[index - 1]]).then(() => {
this.addReferences(this.corpusProvider.currentCorpus.citation_level_3, [this.corpusProvider.currentCorpus.citations[citationLabels[index - 2]], this.corpusProvider.currentCorpus.citations[citationLabels[index - 2]].subcitations[citationLabels[index - 1]]]).then(() => {
valueList.push(this.corpusProvider.currentCorpus.citations[citationLabels[index - 2]].subcitations[citationLabels[index - 1]].subcitations[label].value);
resolve();
});
......@@ -289,7 +289,7 @@ export class TextRangePage {
if (citationLabels.length === 1 && this.corpusProvider.currentCorpus.citation_level_2 !== CitationLevel[CitationLevel.default]) {
this.currentlyAvailableCitations = [];
if (Object.keys(this.corpusProvider.currentCorpus.citations[citationLabels[0]].subcitations).length === 0) {
this.addReferences(this.corpusProvider.currentCorpus.citation_level_2, [citationLabels[0]]).then(() => {
this.addReferences(this.corpusProvider.currentCorpus.citation_level_2, [this.corpusProvider.currentCorpus.citations[citationLabels[0]]]).then(() => {
resolve();
});
}
......@@ -307,7 +307,7 @@ export class TextRangePage {
resolve();
}
if (Object.keys(this.corpusProvider.currentCorpus.citations[citationLabels[0]].subcitations[citationLabels[1]].subcitations).length === 0) {
this.addReferences(this.corpusProvider.currentCorpus.citation_level_3, [citationLabels[0], citationLabels[1]]).then(() => {
this.addReferences(this.corpusProvider.currentCorpus.citation_level_3, [this.corpusProvider.currentCorpus.citations[citationLabels[0]], this.corpusProvider.currentCorpus.citations[citationLabels[0]].subcitations[citationLabels[1]]]).then(() => {
resolve();
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment