show-text.page.html 4.61 KB
Newer Older
1
2
<ion-header>
    <ion-toolbar>
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
        <ion-buttons slot="start">
            <div class="home-logo">
                <a href="../home">
                    <img src="assets/imgs/logo.png" width="32px" height="32px" alt="CALLIDUS Logo">
                </a>
            </div>
            <div>
                <ion-spinner *ngIf="HelperService.isLoading"></ion-spinner>
                <ion-title>{{corpusService.currentCorpus?.title}}
                    {{corpusService.currentUrn?.split(":")[corpusService.currentUrn?.split(":").length - 1]}}
                </ion-title>
            </div>
        </ion-buttons>
        <ion-buttons slot="end">
            <ion-menu-button autoHide="false"></ion-menu-button>
        </ion-buttons>
19
20
21
22
23
    </ion-toolbar>
</ion-header>


<ion-content padding>
24
25
26
    <h2 padding>
        {{'SHOW_TEXT_TITLE' | translate}}
    </h2>
27
    <ion-grid *ngIf="corpusService.currentText.length > 0; else loading">
28
        <ion-row *ngIf="HelperService.isVocabularyCheck">
29
            <ion-col style="text-align:left; padding-left:10px;">
30
                <label>
31
                    <input type="checkbox" [(ngModel)]="highlightOOV" />
32
                    <span class="checkbox">{{ "TEXT_SHOW_OOV" | translate}}</span>
33
34
35
36
                </label>
                <br>
            </ion-col>
        </ion-row>
37
        <ion-row>
38
39
40
41
42
43
44
45
46
            <ion-col class="text" size="8">
                <div *ngIf="highlightOOV; else noOOV">
                    <!-- do not add whitespace/newline etc. between the span elements!                   -->
                    <span *ngFor="let node of corpusService.annisResponse.nodes; index as i"><span class="tok"
                            [class.oov]="node.is_oov">{{node.annis_tok}}</span>{{ getWhiteSpace(i) }}</span>
                </div>
                <ng-template #noOOV>
                    <span class="tok">{{corpusService.currentText}}</span>
                </ng-template>
47
            </ion-col>
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
            <ion-col class="toggle-menu" style="text-align:left" padding>
                <button *ngIf="showTextComplexity; else dropright" (click)="showTextComplexity = !showTextComplexity">
                    <ion-icon name="arrow-dropdown"></ion-icon>
                </button>
                <ng-template #dropright>
                    <button (click)="showTextComplexity = !showTextComplexity">
                        <ion-icon name="arrow-dropright"></ion-icon>
                    </button>
                </ng-template>
                <div>
                    <h2 (click)="showTextComplexity = !showTextComplexity">{{ 'TEXT_COMPLEXITY' | translate }}</h2>
                </div>
                <br>
                <div *ngIf="showTextComplexity" style="text-align:left">
                    <label *ngFor="let key of ObjectKeys(textComplexityMap)">
                        {{ textComplexityMap[key] | translate }}:
                        {{corpusService.annisResponse.text_complexity[key]}}<br>
                    </label>
                    <br>
                </div>
                <br>
69
70
                <ion-button (click)="generateDownloadLink(FileType[FileType.docx])">
                    {{ 'GENERATE_FILE_DOCX' | translate }}
71
72
73
74
75
76
77
78
                </ion-button><br>
                <ion-button (click)="generateDownloadLink(FileType[FileType.pdf])">
                    {{ 'GENERATE_FILE_PDF' | translate }}
                </ion-button><br>
                <ion-button (click)="HelperService.goToVocabularyCheckPage(navCtrl)">
                    {{ 'VOCABULARY_CHECK' | translate }}</ion-button><br>
                <ion-button (click)="HelperService.goToExerciseParametersPage(navCtrl).then()">
                    {{ "EXERCISE_SET_PARAMETERS" | translate}}</ion-button>
79
80
81
82
83
84
85
86
87
88
89
            </ion-col>
        </ion-row>
        <ion-row>
            <ion-col>
                <ion-spinner *ngIf="isDownloading"></ion-spinner>
                <!--  hidden download link, do not delete this!
                This is preferable compared to a button click event, because the browser knows from the beginning that
                it is going to be a download (instead of an ordinary link or click).         -->
                <a style="display: none" id="download" href="" download>Download</a>
            </ion-col>
        </ion-row>
90
91
        <ion-row>
        </ion-row>
92
        <ion-row>
93
94
            <ion-col size="2">
                <ion-button (click)="HelperService.goToTextRangePage(navCtrl)">{{ 'BACK' | translate }}</ion-button>
95
            </ion-col>
96
97
98
           <ion-col>

           </ion-col>
99
100
101
102
103
        </ion-row>
    </ion-grid>
    <ng-template #loading>
        <ion-spinner></ion-spinner>
    </ng-template>
104
</ion-content>