Commit 8f798955 authored by Konstantin Schulz's avatar Konstantin Schulz
Browse files

introducing the vocabulary filter

parent bacb481a
This diff is collapsed.
{
"name": "mcClient",
"version": "0.2.3",
"version": "0.2.5",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
......@@ -12,36 +12,37 @@
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/animations": "5.2.11",
"@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",
"@angular/forms": "5.2.11",
"@angular/http": "5.2.11",
"@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11",
"@ionic-native/core": "4.7.0",
"@ionic-native/status-bar": "4.7.0",
"@ionic/storage": "2.1.3",
"@angular/animations": "^5.2.11",
"@angular/common": "^5.2.11",
"@angular/compiler": "^5.2.11",
"@angular/compiler-cli": "^5.2.11",
"@angular/core": "^5.2.11",
"@angular/forms": "^5.2.11",
"@angular/http": "^5.2.11",
"@angular/platform-browser": "^5.2.11",
"@angular/platform-browser-dynamic": "^5.2.11",
"@ionic-native/core": "^4.17.0",
"@ionic-native/status-bar": "^4.17.0",
"@ionic/storage": "^2.2.0",
"@ngx-translate/core": "^9.1.1",
"@ngx-translate/http-loader": "^2.0.1",
"@types/xml2js": "^0.4.3",
"ajv": "^5.0.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.0.5",
"cordova-plugin-ionic-webview": "^1.1.19",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "^2.2.3",
"cordova-plugin-whitelist": "^1.3.3",
"ionic": "^4.0.6",
"ionic": "^4.3.1",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"rxjs": "5.5.11",
"socks": "^2.2.1",
"ionicons": "^4.4.7",
"rxjs": "^5.5.11",
"socks": "^2.2.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.26"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.10",
"typescript": "~2.6.2"
"@ionic/app-scripts": "^3.2.0",
"typescript": "^2.9.2"
},
"description": "An Ionic project",
"cordova": {
......
......@@ -18,6 +18,7 @@ import {AuthorPageModule} from "../pages/author/author.module";
import {HelperProvider} from '../providers/helper/helper';
import {FeedbackPageModule} from "../pages/feedback/feedback.module";
import {VocabularyCheckPageModule} from "../pages/vocabulary-check/vocabulary-check.module";
import {VocabularyProvider} from '../providers/vocabulary/vocabulary';
// The translate loader needs to know where to load i18n files
// in Ionic's static asset pipeline.
......@@ -67,6 +68,7 @@ class CustomErrorHandler extends IonicErrorHandler {
{provide: ErrorHandler, useClass: CustomErrorHandler},
CorpusProvider,
ExerciseProvider,
VocabularyProvider,
]
})
export class AppModule {
......
......@@ -4,6 +4,7 @@
"backendApiFilePath": "file",
"backendApiRawtextPath": "rawtext",
"backendApiValidReffPath": "validReff",
"backendApiVocabularyPath": "vocabulary",
"backendBaseUrl": "",
"backendProxyPath": "mc-service/mc/api/v1.0",
"callidusProjectUrl": "https://www.projekte.hu-berlin.de/de/callidus",
......
......@@ -3,6 +3,13 @@
"AUTHOR_SEARCH": "Autor suchen...",
"AUTHOR_SELECT": "Autor auswählen",
"CALLIDUS_PROJECT": "CALLIDUS-Projekt",
"CASE_ABLATIVE": "Ablativ",
"CASE_ACCUSATIVE": "Akkusativ",
"CASE_DATIVE": "Dativ",
"CASE_GENITIVE": "Genitiv",
"CASE_LOCATIVE": "Lokativ",
"CASE_NOMINATIVE": "Nominativ",
"CASE_VOCATIVE": "Vokativ",
"CORPORA_REFRESH": "Korpora aktualisieren",
"CORPUS_UPDATE_COMPLETED": "Korpus-Update abgeschlossen",
"DEPENDENCY_ADJECTIVAL_CLAUSE": "Attributsatz",
......@@ -66,7 +73,10 @@
"INSTRUCTIONS": "Anweisungen",
"INSTRUCTIONS_CLOZE": "Ordne die Wörter aus dem Pool den richtigen Lücken zu!",
"INSTRUCTIONS_MATCHING": "Ordne die zusammengehörigen Elemente einander zu!",
"INVALID_QUERY_CORPUS": "Ungültiges Korpus für die Suchanfrage",
"INVALID_SENTENCE_COUNT": "Ungültige Anzahl der Sätze",
"INVALID_TEXT_RANGE": "Ungültige Textauswahl",
"MACHINA_CALLIDA": "Machina Callida",
"MACHINA_CALLIDA_BACKEND": "Machina Callida Backend",
"MACHINA_CALLIDA_FRONTEND": "Machina Callida Frontend",
"PART_OF_SPEECH_ADJECTIVE": "Adjektiv",
......@@ -84,6 +94,7 @@
"PART_OF_SPEECH_PUNCTUATION": "Interpunktion",
"PART_OF_SPEECH_SYMBOL": "Symbol",
"PART_OF_SPEECH_VERB": "Verb",
"PHENOMENON_CASE": "Kasus",
"PHENOMENON_DEPENDENCY": "Dependenz",
"PHENOMENON_LEMMA": "Lemma",
"PHENOMENON_PART_OF_SPEECH": "Wortart",
......@@ -91,10 +102,24 @@
"QUERY_PHENOMENON": "Phänomen",
"QUERY_VALUE": "Suche",
"QUERY_VALUE_EMPTY": "Keine Suchanfrage ausgewählt",
"SHOW": "Anzeigen",
"SELECTION_CONFIRM": "Auswahl bestätigen",
"SOLUTIONS_SHUFFLE": "Mischen",
"START": "Anfang",
"TEST": "Test",
"TEXT_TOO_LONG": "Text zu lang, max. Wortzahl: ",
"WANTED": "Gesucht",
"WELCOME": "Willkommen!"
"VOCABULARY_CHECK": "Vokabular vergleichen",
"VOCABULARY_CHOOSE_CORPUS": "Korpus auswählen...",
"VOCABULARY_ITEMS": "Vokabeln",
"VOCABULARY_MATCHING_DEGREE": "Übereinstimmung",
"VOCABULARY_MATCHING_PERCENTAGE_WANTED": "Gewünschter Grad der Übereinstimmung",
"VOCABULARY_RANKING": "Ranking",
"VOCABULARY_REFERENCE_CORPUS": "Korpus für das Referenzvokabular",
"VOCABULARY_REFERENCE_CORPUS_AGLDT": "Ancient Greek and Latin Dependency Treebank",
"VOCABULARY_REFERENCE_CORPUS_BWS": "Bamberger Wortschatz",
"VOCABULARY_REFERENCE_CORPUS_VIVA": "VIVA 1 + 2 Wortschatz",
"VOCABULARY_REFERENCE_RANGE": "Nur die häufigsten ... Wörter aus dem Referenzvokabular verwenden",
"VOCABULARY_QUERY_CORPUS": "Wo soll gesucht werden?",
"VOCABULARY_SENTENCE_COUNT": "Gewünschte Anzahl der Sätze",
"VOCABULARY_SENTENCE_IDS": "Sätze",
"WANTED": "Gesucht"
}
\ No newline at end of file
......@@ -3,6 +3,13 @@
"AUTHOR_SEARCH": "Search author...",
"AUTHOR_SELECT": "Select author",
"CALLIDUS_PROJECT": "CALLIDUS Project",
"CASE_ABLATIVE": "Ablative",
"CASE_ACCUSATIVE": "Accusative",
"CASE_DATIVE": "Dative",
"CASE_GENITIVE": "Genitive",
"CASE_LOCATIVE": "Locative",
"CASE_NOMINATIVE": "Nominative",
"CASE_VOCATIVE": "Vocative",
"CORPORA_REFRESH": "Refresh corpora",
"CORPUS_UPDATE_COMPLETED": "Corpus update completed",
"DEPENDENCY_ADJECTIVAL_CLAUSE": "Adjectival Clause",
......@@ -66,7 +73,10 @@
"INSTRUCTIONS": "Instructions",
"INSTRUCTIONS_CLOZE": "Assign the words from the pool to the correct gaps!",
"INSTRUCTIONS_MATCHING": "Assign the matching elements to each other!",
"INVALID_QUERY_CORPUS": "Invalid corpus for the query",
"INVALID_SENTENCE_COUNT": "Invalid number of sentences",
"INVALID_TEXT_RANGE": "Invalid text range",
"MACHINA_CALLIDA": "Machina Callida",
"MACHINA_CALLIDA_BACKEND": "Machina Callida Backend",
"MACHINA_CALLIDA_FRONTEND": "Machina Callida Frontend",
"PART_OF_SPEECH_ADJECTIVE": "Adjective",
......@@ -84,6 +94,7 @@
"PART_OF_SPEECH_PUNCTUATION": "Punctuation",
"PART_OF_SPEECH_SYMBOL": "Symbol",
"PART_OF_SPEECH_VERB": "Verb",
"PHENOMENON_CASE": "Kasus",
"PHENOMENON_DEPENDENCY": "Dependency",
"PHENOMENON_LEMMA": "Lemma",
"PHENOMENON_PART_OF_SPEECH": "Part of speech",
......@@ -91,10 +102,24 @@
"QUERY_PHENOMENON": "Phenomenon",
"QUERY_VALUE": "Search",
"QUERY_VALUE_EMPTY": "Query value is empty",
"SHOW": "Show",
"SELECTION_CONFIRM": "Confirm selection",
"SOLUTIONS_SHUFFLE": "Shuffle",
"START": "Start",
"TEST": "Test",
"TEXT_TOO_LONG": "Text too long, max. word count: ",
"WANTED": "Wanted",
"WELCOME": "Welcome!"
"VOCABULARY_CHECK": "Compare vocabulary",
"VOCABULARY_CHOOSE_CORPUS": "Choose corpus...",
"VOCABULARY_ITEMS": "Items",
"VOCABULARY_MATCHING_DEGREE": "Matching Percentage",
"VOCABULARY_MATCHING_PERCENTAGE_WANTED": "Desired percentage of matching vocabulary",
"VOCABULARY_RANKING": "Ranking",
"VOCABULARY_REFERENCE_CORPUS": "Corpus for the reference vocabulary",
"VOCABULARY_REFERENCE_CORPUS_AGLDT": "Ancient Greek and Latin Dependency Treebank",
"VOCABULARY_REFERENCE_CORPUS_BWS": "Bamberg Core Vocabulary",
"VOCABULARY_REFERENCE_CORPUS_VIVA": "VIVA textbook 1 + 2 Vocabulary",
"VOCABULARY_REFERENCE_RANGE": "Take only the ... most frequent words in the reference vocabulary",
"VOCABULARY_QUERY_CORPUS": "Where to perform the search",
"VOCABULARY_SENTENCE_COUNT": "Desired number of sentences",
"VOCABULARY_SENTENCE_IDS": "Sentences",
"WANTED": "Wanted"
}
\ No newline at end of file
......@@ -12,6 +12,12 @@ export enum ExerciseTypeTranslation {
matching = <any>"EXERCISE_TYPE_MATCHING",
}
export enum FileType {
docx = <any>"docx",
pdf = <any>"pdf",
xml = <any>"xml",
}
export enum InstructionsTranslation {
cloze = <any>"INSTRUCTIONS_CLOZE",
matching = <any>"INSTRUCTIONS_MATCHING",
......@@ -23,17 +29,51 @@ export enum MoodleExerciseType {
}
export enum Phenomenon {
case = <any>"case",
dependency = <any>"dependency",
lemma = <any>"lemma",
partOfSpeech = <any>"partOfSpeech",
}
export enum PhenomenonTranslation {
case = <any>"PHENOMENON_CASE",
dependency = <any>"PHENOMENON_DEPENDENCY",
lemma = <any>"PHENOMENON_LEMMA",
partOfSpeech = <any>"PHENOMENON_PART_OF_SPEECH",
}
export enum VocabularyCorpus {
agldt = <any>"agldt",
bws = <any>"bws",
viva = <any>"viva",
}
export enum VocabularyCorpusTranslation {
agldt = <any>"VOCABULARY_REFERENCE_CORPUS_AGLDT",
bws = <any>"VOCABULARY_REFERENCE_CORPUS_BWS",
viva = <any>"VOCABULARY_REFERENCE_CORPUS_VIVA",
}
export enum CaseValue {
nominative = <any>"nominative",
genitive = <any>"genitive",
dative = <any>"dative",
accusative = <any>"accusative",
ablative = <any>"ablative",
vocative = <any>"vocative",
locative = <any>"locative",
}
export enum CaseTranslations {
nominative = <any>"CASE_NOMINATIVE",
genitive = <any>"CASE_GENITIVE",
dative = <any>"CASE_DATIVE",
accusative = <any>"CASE_ACCUSATIVE",
ablative = <any>"CASE_ABLATIVE",
vocative = <any>"CASE_VOCATIVE",
locative = <any>"CASE_LOCATIVE",
}
export enum DependencyValue {
adjectivalClause = <any>"adjectivalClause",
adjectivalModifier = <any>"adjectivalModifier",
......@@ -135,9 +175,3 @@ export enum PartOfSpeechTranslation {
symbol = <any>"PART_OF_SPEECH_SYMBOL",
verb = <any>"PART_OF_SPEECH_VERB",
}
export enum FileType {
docx = <any>"docx",
pdf = <any>"pdf",
xml = <any>"xml",
}
import {RequestMC} from "./requestMC";
import {Reply} from "./reply";
export class GetValidReff {
public request: RequestMC;
public reply: Reply;
constructor(init?:Partial<GetValidReff>) {
Object.assign(this, init);
}
}
......@@ -7,6 +7,7 @@ export class NodeMC {
public udep_lemma: string;
public udep_upostag: string;
public udep_xpostag: string;
public udep_feats: string;
public solution: string;
constructor(init?:Partial<NodeMC>) {
Object.assign(this, init);
......
export class Reff {
public urn: string[];
constructor(init?:Partial<Reff>) {
Object.assign(this, init);
}
}
import {Reff} from "./reff";
export class Reply {
public reff: Reff;
constructor(init?:Partial<Reply>) {
Object.assign(this, init);
}
}
export class RequestMC {
public requestLevel: string;
public requestName: string;
public requestUrn: string;
constructor(init?:Partial<RequestMC>) {
Object.assign(this, init);
}
}
export class Sentence {
public id: number;
public matching_degree: number;
constructor(init?:Partial<Sentence>) {
Object.assign(this, init);
}
}
export class Vocabulary {
public hasFrequencyOrder: boolean;
public possibleSubcounts: number[];
public totalCount: number;
constructor(init?:Partial<Vocabulary>) {
Object.assign(this, init);
}
}
......@@ -21,7 +21,7 @@
<ion-content padding>
<ion-list>
<ion-item-sliding *ngFor="let corpus of corpusProvider.currentAuthor.corpora">
<button ion-item (click)="showPossibleReferences(corpus, 1)">
<button ion-item (click)="showPossibleReferences(corpus)">
<p>{{corpus.title}}</p>
</button>
</ion-item-sliding>
......
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {IonicPage, NavController, NavParams, ViewController} from 'ionic-angular';
import {CorpusProvider} from "../../providers/corpus/corpus";
import {CorpusMC} from "../../models/corpusMC";
import {TranslateService} from "@ngx-translate/core";
import {HttpClient} from "@angular/common/http";
import {CorpusDetailPage} from "../corpus-detail/corpus-detail";
import {FeedbackPage} from "../feedback/feedback";
import {VocabularyCheckPage} from "../vocabulary-check/vocabulary-check";
/**
* Generated class for the AuthorDetailPage page.
......@@ -26,10 +27,11 @@ export class AuthorDetailPage {
constructor(public navCtrl: NavController, public navParams: NavParams,
public corpusProvider: CorpusProvider,
public translate: TranslateService,
public http: HttpClient) {
public http: HttpClient,
public viewCtrl: ViewController) {
}
showPossibleReferences(corpus: CorpusMC, level: number) {
showPossibleReferences(corpus: CorpusMC) {
this.corpusProvider.currentCorpus = corpus;
this.navCtrl.push(CorpusDetailPage).then();
}
......
import {Component} from '@angular/core';
import {IonicPage, NavController} from 'ionic-angular';
import {IonicPage, NavController, ViewController} from 'ionic-angular';
import {HttpClient} from "@angular/common/http";
import {TranslateService} from "@ngx-translate/core";
import {Author} from "../../models/author";
import {CorpusProvider} from "../../providers/corpus/corpus";
import {AuthorDetailPage} from "../author-detail/author-detail";
import {FeedbackPage} from "../feedback/feedback";
import {VocabularyCheckPage} from "../vocabulary-check/vocabulary-check";
/**
* Generated class for the AuthorPage page.
......@@ -26,8 +27,10 @@ export class AuthorPage {
constructor(public navCtrl: NavController,
public translate: TranslateService,
public corpusProvider: CorpusProvider,
public http: HttpClient) {
public http: HttpClient,
public viewCtrl: ViewController) {
this.authorsDisplayed = this.corpusProvider.availableAuthors;
this.corpusProvider.isTextRangeCorrect = false;
}
getAuthors(event) { // Type: InputEvent
......
......@@ -22,7 +22,7 @@
<ion-grid>
<ion-row>
<ion-col>
<button ion-button block (click)="showText()">{{ "SHOW" | translate }}</button>
<button ion-button block (click)="showText()">{{ "SELECTION_CONFIRM" | translate }}</button>
</ion-col>
</ion-row>
<ion-row>
......
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams, ToastController} from 'ionic-angular';
import {IonicPage, NavController, NavParams, ToastController, ViewController} from 'ionic-angular';
import {CorpusProvider} from "../../providers/corpus/corpus";
import {CitationLevel} from "../../models/enum";
import {ShowTextPage} from "../show-text/show-text";
......@@ -8,6 +8,8 @@ import {TranslateService} from "@ngx-translate/core";
import {Citation} from "../../models/citation";
import {FeedbackPage} from "../feedback/feedback";
import {BaseInput} from "ionic-angular/es2015/util/base-input";
import {VocabularyCheckPage} from "../vocabulary-check/vocabulary-check";
import {HelperProvider} from "../../providers/helper/helper";
/**
* Generated class for the CorpusDetailPage page.
......@@ -38,8 +40,10 @@ export class CorpusDetailPage {
constructor(public navCtrl: NavController, public navParams: NavParams,
public corpusProvider: CorpusProvider,
public toastCtrl: ToastController,
public translateService: TranslateService) {
public translateService: TranslateService,
public viewCtrl: ViewController) {
this.currentlyAvailableCitations = [];
this.corpusProvider.isTextRangeCorrect = false;
this.corpusProvider.currentTextRange = new TextRange({start: "", end: ""});
if (Object.keys(this.corpusProvider.currentCorpus.citations).length === 0) {
this.addReferences(this.corpusProvider.currentCorpus.citation_level_1).then(() => {
......@@ -201,7 +205,7 @@ export class CorpusDetailPage {
public mapCitationLabelsToValues(label: string, index: number, citationLabels: string[], valueList: number[]) {
return new Promise(resolve => {
if (index === 0) {
if (index === 0 && this.corpusProvider.currentCorpus.citations[label]) {
valueList.push(this.corpusProvider.currentCorpus.citations[label].value);
resolve();
}
......@@ -229,6 +233,9 @@ export class CorpusDetailPage {
resolve();
}
}
else if (!!+label) {
valueList.push(+label);
}
});
}
......@@ -268,7 +275,13 @@ export class CorpusDetailPage {
let newUrnBase: string = this.corpusProvider.currentCorpus.source_urn + ":";
this.corpusProvider.currentUrn = newUrnBase + this.citationValuesStart.join(".") + "-" + this.citationValuesEnd.join(".");
this.corpusProvider.currentText = "";
this.navCtrl.push(ShowTextPage).then();
if (HelperProvider.isVocabularyCheck) {
this.corpusProvider.isTextRangeCorrect = true;
this.navCtrl.push(VocabularyCheckPage).then();
}
else {
this.navCtrl.push(ShowTextPage).then();
}
});
}
......
<ion-header>
<ion-navbar>
<ion-title>
{{ 'WELCOME' | translate }}
{{ 'MACHINA_CALLIDA' | translate }}
</ion-title>
<ion-buttons end>
<button padding-right ion-button color="primary" (click)="refreshCorpora()">{{ 'CORPORA_REFRESH' | translate }}</button>
<button ion-button icon-only color="primary" (click)="navCtrl.push(FeedbackPage)">
<ion-icon name="help-circle"></ion-icon>
</button>
......@@ -12,10 +13,24 @@
</ion-header>
<ion-content padding>
<div *ngIf="!isCorpusUpdateInProgress; else loading"></div>
<button ion-button block (click)="goToAuthorPage()">{{ 'AUTHOR_SELECT' | translate }}</button>
<button ion-button block (click)="refreshCorpora()">{{ 'CORPORA_REFRESH' | translate }}</button>
<button ion-button block (click)="test()" [ngClass]="isProductionEnv">{{ 'TEST' | translate }}</button>
<ion-grid *ngIf="!isCorpusUpdateInProgress; else loading">
<ion-row>
<ion-col>
<button ion-button (click)="goToAuthorPage()">{{ 'EXERCISE_GENERATE' | translate }}</button>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<button ion-button (click)="goToVocabularyCheckPage()">{{ 'VOCABULARY_CHECK' | translate }}</button>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<br>
<button ion-button (click)="test()" [ngClass]="isProductionEnv">{{ 'TEST' | translate }}</button>
</ion-col>
</ion-row>
</ion-grid>
<ng-template #loading>
<ion-spinner></ion-spinner>
</ng-template>
......
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