Datasets:

Modalities:
Text
Languages:
Icelandic
Libraries:
Datasets
License:
File size: 38,087 Bytes
eaf89e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a0ac7d9
eaf89e1
a0ac7d9
 
 
 
 
eaf89e1
 
 
 
 
5a3458b
eaf89e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20218bd
eaf89e1
 
 
 
 
 
 
 
 
 
 
7d8f434
0b0f2c2
9a8ea3c
393fae1
9a8ea3c
eaf89e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13b27e5
 
 
eaf89e1
7d8f434
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
# collected from errorCodes.tsv -- see https://github.com/antonkarl/iceErrorCorpus
ERROR_INFORMATION = {'dem4noun': {'category': 'coherence',
  'subcategory': 'accuracy',
  'description': 'A demonstrative pronoun used where a noun should be'},
 'noun4dem': {'category': 'coherence',
  'subcategory': 'accuracy',
  'description': 'A noun used where a demonstrative pronoun should be'},
 'dem-pro': {'category': 'coherence',
  'subcategory': 'pro',
  'description': 'An incorrect demonstrative pronoun used'},
 'dem4pers': {'category': 'coherence',
  'subcategory': 'pro',
  'description': 'A demonstrative pronoun used where a personal pronoun should be used'},
 'noun4pro': {'category': 'coherence',
  'subcategory': 'pro',
  'description': 'A noun used where a pronoun should be used'},
 'pers4dem': {'category': 'coherence',
  'subcategory': 'pro',
  'description': 'A personal pronoun used instead of a demonstrative pronoun'},
 'pro4noun': {'category': 'coherence',
  'subcategory': 'pro',
  'description': 'A pronoun used where a noun should be used'},
 'pro4reflexive': {'category': 'coherence',
  'subcategory': 'pro',
  'description': 'A personal pronoun used instead of a reflexive pronoun'},
 'reflexive4noun': {'category': 'coherence',
  'subcategory': 'pro',
  'description': 'A reflexive pronoun used instead of a noun'},
 'reflexive4pro': {'category': 'coherence',
  'subcategory': 'pro',
  'description': 'A reflexive pronoun used instead of a personal pronoun'},
 'dir4loc': {'category': 'coherence',
  'subcategory': 'reference',
  'description': 'Directional instead of locative'},
 'loc4dir': {'category': 'coherence',
  'subcategory': 'reference',
  'description': 'Locative instead of directional'},
 'agreement': {'category': 'grammar',
  'subcategory': 'agreement',
  'description': 'A finite verb not in agreement with a noun phrase'},
 'agreement-concord': {'category': 'grammar',
  'subcategory': 'agreement',
  'description': 'An error in agreement within a noun phrase'},
 'agreement-pred': {'category': 'grammar',
  'subcategory': 'agreement',
  'description': 'A predicate not in agreement with its subject'},
 'agreement-pro': {'category': 'grammar',
  'subcategory': 'agreement',
  'description': 'A pronoun not in agreement with its antecedent'},
 'marked4unmarked': {'category': 'grammar',
  'subcategory': 'agreement',
  'description': 'A marked grammatical gender used instead of the unmarked one, the feminine or neuter used instead of masculine'},
 'cont4simple': {'category': 'grammar',
  'subcategory': 'aspect',
  'description': 'A verb in the continuous tense which should be in the simple tense'},
 'perfect4tense': {'category': 'grammar',
  'subcategory': 'aspect',
  'description': 'A verb in the perfect aspect which should be in the present or past tense'},
 'simple4cont': {'category': 'grammar',
  'subcategory': 'aspect',
  'description': 'A verb in the simple tense which should be in the continuous tense'},
 'tense4perfect': {'category': 'grammar',
  'subcategory': 'aspect',
  'description': 'A verb in the present or past tense which should be in the perfect aspect'},
 'extra-munu': {'category': 'grammar',
  'subcategory': 'aux',
  'description': 'Redundant verb ‘munu’ used'},
 'geta': {'category': 'grammar',
  'subcategory': 'aux',
  'description': 'The verb ‘geta’ used with an infinitive or a verb in the present tense'},
 'acc4nom-sub': {'category': 'grammar',
  'subcategory': 'case',
  'description': 'A subject in the accusative case which should be in the nominative case'},
 'case-adj': {'category': 'grammar',
  'subcategory': 'case',
  'description': 'A word whose case is governed by an adjective is not in the correct case'},
 'case-collocation': {'category': 'grammar',
  'subcategory': 'case',
  'description': 'Incorrect case within a collocation'},
 'case-prep': {'category': 'grammar',
  'subcategory': 'case',
  'description': 'A word whose case is governed by a preposition is not in the correct case'},
 'case-verb': {'category': 'grammar',
  'subcategory': 'case',
  'description': 'A word whose case is governed by a verb is not in the correct case'},
 'dative-sub': {'category': 'grammar',
  'subcategory': 'case',
  'description': 'A subject incorrectly in the dative case'},
 'nom4acc-sub': {'category': 'grammar',
  'subcategory': 'case',
  'description': 'A subject in the nominal case which should be in the accusative case'},
 'conjunction': {'category': 'grammar',
  'subcategory': 'conjunction',
  'description': 'A conjunction used incorrectly'},
 'def4ind': {'category': 'grammar',
  'subcategory': 'definitiveness',
  'description': 'An definite word which should be indefinite'},
 'extra-dem-pro': {'category': 'grammar',
  'subcategory': 'definitiveness',
  'description': 'A redundant demonstrative pronoun'},
 'ind4def': {'category': 'grammar',
  'subcategory': 'definitiveness',
  'description': 'An indefinite word which should be definite'},
 'missing-dem-pro': {'category': 'grammar',
  'subcategory': 'definitiveness',
  'description': 'A demonstrative pronoun missing'},
 'adjective-inflection': {'category': 'grammar',
  'subcategory': 'inflection',
  'description': 'An adjective inflected incorrectly'},
 'gen-escape': {'category': 'grammar',
  'subcategory': 'inflection',
  'description': 'A noun which should be in the genitive case is incorrectly in another case'},
 'genitive': {'category': 'grammar',
  'subcategory': 'inflection',
  'description': 'Errors related to the genitive case'},
 'nominal-inflection': {'category': 'grammar',
  'subcategory': 'inflection',
  'description': 'A noun inflected incorrectly, i.e. the inflection form exists but does not fit in the sentence'},
 'numeral-inflection': {'category': 'grammar',
  'subcategory': 'inflection',
  'description': 'A numeral inflected incorrectly'},
 'pro-inflection': {'category': 'grammar',
  'subcategory': 'inflection',
  'description': 'A pronoun inflected incorrectly'},
 'verb-inflection': {'category': 'grammar',
  'subcategory': 'inflection',
  'description': 'A verb inflected incorrectly'},
 'want': {'category': 'grammar',
  'subcategory': 'inflection',
  'description': 'The third person singular ‘vill’ used where the first person singular ‘vil’ should be used, and the opposite'},
 'extra-prep': {'category': 'grammar',
  'subcategory': 'insertion',
  'description': 'A redundant preposition'},
 'ind4sub': {'category': 'grammar',
  'subcategory': 'mood',
  'description': 'A verb in the indicative mood which should be in the subjunctive mood'},
 'sub4ind': {'category': 'grammar',
  'subcategory': 'mood',
  'description': 'A verb in the subjunctive mood which should be in the indicative mood'},
 'missing-prep': {'category': 'grammar',
  'subcategory': 'omission',
  'description': 'A preposition missing'},
 'að4af': {'category': 'grammar',
  'subcategory': 'prep',
  'description': 'The preposition ‘að’ used instead of the preposition ‘af’'},
 'af4að': {'category': 'grammar',
  'subcategory': 'prep',
  'description': 'The preposition ‘af’ used instead of the preposition ‘að’'},
 'wrong-prep': {'category': 'grammar',
  'subcategory': 'prep',
  'description': 'An incorrect preposition used'},
 'adj4adv': {'category': 'grammar',
  'subcategory': 'syntax',
  'description': 'An adjective used where an adverb should be'},
 'adv4adj': {'category': 'grammar',
  'subcategory': 'syntax',
  'description': 'An adverb used where an adjective should be'},
 'each': {'category': 'grammar',
  'subcategory': 'syntax',
  'description': 'An error in reciprocal pronouns'},
 'extra-fin-verb': {'category': 'grammar',
  'subcategory': 'syntax',
  'description': 'persónubeygðri sögn ofaukið'},
 'extra-inf-part': {'category': 'grammar',
  'subcategory': 'syntax',
  'description': 'A redundant infinitive particle'},
 'extra-sub': {'category': 'grammar',
  'subcategory': 'syntax',
  'description': 'A redundant subject'},
 'loan-syntax': {'category': 'grammar',
  'subcategory': 'syntax',
  'description': 'Syntax borrowed from another language'},
 'missing-fin-verb': {'category': 'grammar',
  'subcategory': 'syntax',
  'description': 'A finite verb missing from a sentence'},
 'missing-inf-part': {'category': 'grammar',
  'subcategory': 'syntax',
  'description': 'An infinitive particle missing'},
 'missing-obj': {'category': 'grammar',
  'subcategory': 'syntax',
  'description': 'An object missing from a clause'},
 'missing-sub': {'category': 'grammar',
  'subcategory': 'syntax',
  'description': 'A subject missing from a clause'},
 'new-passive': {'category': 'grammar',
  'subcategory': 'syntax',
  'description': 'The new passive construction used'},
 'syntax-other': {'category': 'grammar',
  'subcategory': 'syntax',
  'description': 'An error relating to syntax'},
 'v3': {'category': 'grammar',
  'subcategory': 'syntax',
  'description': 'A verb incorrectly in the third position'},
 'v3-subordinate': {'category': 'grammar',
  'subcategory': 'syntax',
  'description': 'A verb incorrectly in the third position in a subordinate clause'},
 'past4pres': {'category': 'grammar',
  'subcategory': 'tense',
  'description': 'A verb in the past tense which should be in the present tense'},
 'pres4past': {'category': 'grammar',
  'subcategory': 'tense',
  'description': 'A verb in the present tense which should be in the past tense'},
 'act4mid': {'category': 'grammar',
  'subcategory': 'voice',
  'description': 'A verb in active voice which should be in middle voice'},
 'act4pass': {'category': 'grammar',
  'subcategory': 'voice',
  'description': 'A verb in active voice which should be in passive voice'},
 'mid4act': {'category': 'grammar',
  'subcategory': 'voice',
  'description': 'A verb in middle voice which should be in active voice'},
 'mid4pass': {'category': 'grammar',
  'subcategory': 'voice',
  'description': 'A verb in middle voice which should be in passive voice'},
 'pass4act': {'category': 'grammar',
  'subcategory': 'voice',
  'description': 'A verb in passive voice which should be in active voice'},
 'pass4mid': {'category': 'grammar',
  'subcategory': 'voice',
  'description': 'A verb in passive voice which should be in middle voice'},
 'passive': {'category': 'grammar',
  'subcategory': 'voice',
  'description': 'The passive construction incorrectly formed'},
 'caps4low': {'category': 'orthography',
  'subcategory': 'capitalization',
  'description': 'An uppercase letter which should be lowercase'},
 'low4caps': {'category': 'orthography',
  'subcategory': 'capitalization',
  'description': 'An lowercase letter which should be uppercase'},
 'lower4upper-acro': {'category': 'orthography',
  'subcategory': 'capitalization',
  'description': 'A lowercase letter in an acronym which should be upper case'},
 'lower4upper-initial': {'category': 'orthography',
  'subcategory': 'capitalization',
  'description': 'A lowercase letter at the beginning of a sentence which should be upper case'},
 'lower4upper-proper': {'category': 'orthography',
  'subcategory': 'capitalization',
  'description': 'A lowercase letter at the beginning of a proper noun which should be upper case'},
 'upper4lower-common': {'category': 'orthography',
  'subcategory': 'capitalization',
  'description': 'An uppercase letter in a common noun which should be lowercase'},
 'upper4lower-noninitial': {'category': 'orthography',
  'subcategory': 'capitalization',
  'description': 'An uppercase letter not at the beginning of a sentence which should be lowercase'},
 'upper4lower-proper': {'category': 'orthography',
  'subcategory': 'capitalization',
  'description': 'An uppercase letter in a proper noun which should be lowercase'},
 'foreign-error': {'category': 'orthography',
  'subcategory': 'foreign',
  'description': 'An error in a foreign word'},
 'foreign-name': {'category': 'orthography',
  'subcategory': 'foreign',
  'description': 'An error in a foreign name'},
 'compound-collocation': {'category': 'orthography',
  'subcategory': 'nonword',
  'description': 'A compound word not formed according to tradition'},
 'nonword': {'category': 'orthography',
  'subcategory': 'nonword',
  'description': 'A word which does not exist'},
 'abbreviation': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Various errors in abbreviations'},
 'abbreviation-period': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Incorrect use of a period in an abbreviation'},
 'bracket4comma': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A bracket used where a comma should be'},
 'bracket4period': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A bracket used where a period should be'},
 'bracket4square': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A bracket used where a square bracket should be'},
 'colon4comma': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A colon used where a comma should be'},
 'colon4period': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A colon used where a period should be'},
 'colon4semicolon': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A colon used where a semicolon should be'},
 'comma-plus-conjunction': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A comma incorrectly used before a conjunction'},
 'comma4bracket': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A comma used where a bracket should be'},
 'comma4colon': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A comma used where a colon should be'},
 'comma4conjunction': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A comma used where a conjunction should be'},
 'comma4dash': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A comma used where a dash should be'},
 'comma4ex': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A comma used where an exclamation mark should be'},
 'comma4period': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A comma used where a period should be'},
 'comma4qm': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A comma used where a question mark should be'},
 'comma4semicolon': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A comma used where a semicolon should be'},
 'conjunction-drop': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A longer form of a word than necessary is used in contraction'},
 'conjunction4comma': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A conjunction used where a comma should be'},
 'conjunction4period': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A conjunction used where a period should be'},
 'conjunction4qm': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A conjunction used where a question mark should be'},
 'conjunction4semicolon': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A conjunction used instead of a semicolon'},
 'date-abbreviation': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Date abbreviated incorrectly'},
 'dots4comma': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Three dots used where a comma should be'},
 'dots4period': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Three dots used where a period should be'},
 'double-punctuation': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Double punctuation incorrectly used'},
 'emdash4endash': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'An em dash used where an en dash should be'},
 'emdash4hyphen': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'An em dash used where a hyphen should be'},
 'endash4colon': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'An en dash used where a colon should be'},
 'endash4comma': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'An en dash used where a comma should be'},
 'endash4hyphen': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'An en dash used where a hyphen should be'},
 'endash4period': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'An en dash used where a period should be'},
 'endash4semicolon': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'An en dash used where a semicolon should be'},
 'endash4word': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'An en dash used where a word should be'},
 'ex4comma': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'An exclamation mark used where a comma should be'},
 'ex4period': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Exclamation mark used instead of a period'},
 'ex4qm': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Exclamation mark used instead of a question mark'},
 'extra-bracket': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A redundant bracket'},
 'extra-brackets': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Redundant brackets'},
 'extra-colon': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A redundant colon'},
 'extra-comma': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Redundant comma'},
 'extra-commas': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Redundant commas used around an insertion'},
 'extra-conjunction': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A redundant conjunction'},
 'extra-endash': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A redundant en dash used'},
 'extra-hyphen': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A redundant hyphen used'},
 'extra-period': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Redundant period'},
 'extra-punctuation': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Redundant punctuation'},
 'extra-qm': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A redundant question mark'},
 'extra-quot': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A redundant single quote'},
 'extra-quots': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Redundant quotes'},
 'extra-semicolon': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A redundant semicolon'},
 'extra-slash': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A redundant slash'},
 'extra-square': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A redundant square bracket'},
 'hypercorr': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Hypercorrection'},
 'hyphen4colon': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A hyphen used where a colon should be'},
 'hyphen4comma': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A hyphen used where a comma should be'},
 'hyphen4endash': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A hyphen used where an en dash should be'},
 'hyphen4period': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A hyphen used where a period should be'},
 'hyphen4semicolon': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A hyphen used where a semicolon should be'},
 'hyphen4word': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A hyphen used where a word should be'},
 'misplaced-quot': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A quote is in the wrong position within a sentence'},
 'missing-bracket': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A single bracket missing'},
 'missing-colon': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A colon missing'},
 'missing-comma': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A comma missing'},
 'missing-commas': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Commas missing around insertion'},
 'missing-conjunction': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A conjunction missing'},
 'missing-ex': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'An exclamation mark missing'},
 'missing-period': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A period missing'},
 'missing-qm': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A question mark missing'},
 'missing-quot': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A single quote missing'},
 'missing-quots': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Quotes missing'},
 'missing-semicolon': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A semicolon missing from a sentence'},
 'missing-slash': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Slash missing'},
 'missing-square': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A square bracket missing'},
 'missing-symbol': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A symbol missing'},
 'nonsup4sup': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Normal style of script used instead of superscript'},
 'period-plus-conjunction': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A period incorrectly used before a conjunction'},
 'period4colon': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A period used where a colon should be'},
 'period4comma': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A period used where a comma should be'},
 'period4conjunction': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A period used where a conjunction should be'},
 'period4dash': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A period used instead of a dash (en dash or em dash)'},
 'period4ex': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A period used where an exclamation mark should be'},
 'period4qm': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A period used where a question mark should be'},
 'period4semicolon': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A period used instead of a semicolon'},
 'qm4comma': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A question mark used where a comma should be'},
 'qm4ex': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A question mark for an exclamation mark'},
 'qm4period': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A question mark for a period'},
 'semicolon4colon': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A semicolon used where a colon should be'},
 'semicolon4comma': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A semicolon used where a comma should be'},
 'semicolon4conjunction': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'semíkomma fyrir samtengingu'},
 'semicolon4period': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'Semicolon used instead of a period'},
 'slash4hyphen': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A slash used instead of a hyphen'},
 'slash4or': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': "A slash used instead of 'eða'"},
 'square4bracket': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A square bracket used where a bracket should be'},
 'word4endash': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A word used where an en dash should be'},
 'word4symbol': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A word used instead of a symbol'},
 'wrong-quot': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'One part of a quotes pair is the wrong type of quote'},
 'wrong-quots': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'The wrong type of quotes used which do not conform with Icelandic rules'},
 'wrong-symbol': {'category': 'orthography',
  'subcategory': 'punctuation',
  'description': 'A wrong symbol used'},
 'extra-space': {'category': 'orthography',
  'subcategory': 'spacing',
  'description': 'Redundant space'},
 'merged-words': {'category': 'orthography',
  'subcategory': 'spacing',
  'description': 'Words incorrectly joined'},
 'missing-endash': {'category': 'orthography',
  'subcategory': 'spacing',
  'description': 'An en dash missing'},
 'missing-hyphen': {'category': 'orthography',
  'subcategory': 'spacing',
  'description': 'A hyphen missing in a compound'},
 'missing-space': {'category': 'orthography',
  'subcategory': 'spacing',
  'description': 'Space missing'},
 'split-compound': {'category': 'orthography',
  'subcategory': 'spacing',
  'description': 'A compound word split up'},
 'split-word': {'category': 'orthography',
  'subcategory': 'spacing',
  'description': 'A word split in two parts'},
 'split-words': {'category': 'orthography',
  'subcategory': 'spacing',
  'description': 'A word split into more than two parts'},
 'bad-contraction': {'category': 'orthography',
  'subcategory': 'spelling',
  'description': 'An incorrect contraction'},
 'hv4kv': {'category': 'orthography',
  'subcategory': 'spelling',
  'description': 'A word written with ‘hv’ instead of ‘kv’'},
 'i4y': {'category': 'orthography',
  'subcategory': 'spelling',
  'description': '‘i’ written instead of ‘y’'},
 'í4ý': {'category': 'orthography',
  'subcategory': 'spelling',
  'description': '‘í’ written instead of ‘ý’'},
 'kv4hv': {'category': 'orthography',
  'subcategory': 'spelling',
  'description': 'A word written with ‘kv’ instead of ‘hv’'},
 'n4nn': {'category': 'orthography',
  'subcategory': 'spelling',
  'description': '‘n’ written instead of ‘nn’, particularly in an inflectional ending'},
 'name-error': {'category': 'orthography',
  'subcategory': 'spelling',
  'description': 'A proper name written incorrectly'},
 'ngnk': {'category': 'orthography',
  'subcategory': 'spelling',
  'description': 'A broad vowel used before ‘ng’ or ‘nk’'},
 'nn4n': {'category': 'orthography',
  'subcategory': 'spelling',
  'description': '‘nn’ written instead of ‘n’, particularly in an inflectional ending'},
 'pronun-writing': {'category': 'orthography',
  'subcategory': 'spelling',
  'description': 'A word written according to its pronunciation'},
 'u4y': {'category': 'orthography',
  'subcategory': 'spelling',
  'description': '‘U’ written instead of ‘y’ in the two words demonstrated below'},
 'y4i': {'category': 'orthography',
  'subcategory': 'spelling',
  'description': '‘y’ written instead of ‘i’'},
 'ý4í': {'category': 'orthography',
  'subcategory': 'spelling',
  'description': '‘ý’ written instead of ‘í’'},
 'abbreviation4words': {'category': 'orthography',
  'subcategory': 'style',
  'description': 'An abbreviation used instead of the full words'},
 'words4abbreviation': {'category': 'orthography',
  'subcategory': 'style',
  'description': 'Words used instead of their abbreviation'},
 'extra-accent': {'category': 'orthography',
  'subcategory': 'typo',
  'description': 'A redundant accent used with a letter'},
 'extra-letter': {'category': 'orthography',
  'subcategory': 'typo',
  'description': 'A redundant letter in a word'},
 'extra-letters': {'category': 'orthography',
  'subcategory': 'typo',
  'description': 'More than one redundant letter in a word'},
 'letter-rep': {'category': 'orthography',
  'subcategory': 'typo',
  'description': 'A letter within a word replaced with another letter'},
 'missing-accent': {'category': 'orthography',
  'subcategory': 'typo',
  'description': 'An accent missing from a letter'},
 'missing-letter': {'category': 'orthography',
  'subcategory': 'typo',
  'description': 'A letter missing in a word'},
 'missing-letters': {'category': 'orthography',
  'subcategory': 'typo',
  'description': 'More than one letter missing in a word'},
 'swapped-letters': {'category': 'orthography',
  'subcategory': 'typo',
  'description': 'Letters within a word swapped'},
 'wrong-accent': {'category': 'orthography',
  'subcategory': 'typo',
  'description': 'A wrong accent used with a letter or an accent used with an incorrect letter'},
 'dep': {'category': 'other',
  'subcategory': 'other',
  'description': 'An error dependent on another one'},
 'gendered': {'category': 'style',
  'subcategory': 'exclusion',
  'description': 'Gendered language'},
 'extra-number': {'category': 'style',
  'subcategory': 'numbers',
  'description': 'A redundant number'},
 'number-fail': {'category': 'style',
  'subcategory': 'numbers',
  'description': 'An error relating to a number'},
 'number4word': {'category': 'style',
  'subcategory': 'numbers',
  'description': 'A numeral used instead of a word. All numbers below and including 10 should be written as a word, except when they appear as part of a date or before a unit of measurement. Ordinals which are part of a proper name are always written as numerals.'},
 'symbol4number': {'category': 'style',
  'subcategory': 'numbers',
  'description': 'A symbol used instead of a numeral'},
 'word4number': {'category': 'style',
  'subcategory': 'numbers',
  'description': 'A word used instead of a numeral. All numbers higher than 10 should be written as a numeral, except when a number lower than 11 appears immediately before or after a number higher than that. Ordinals which are part of a proper name are always written as numerals.'},
 'extra-symbol': {'category': 'style',
  'subcategory': 'other',
  'description': 'A redundant symbol'},
 'symbol4word': {'category': 'style',
  'subcategory': 'other',
  'description': 'A symbol used where a word should be'},
 'fw4ice': {'category': 'style',
  'subcategory': 'style',
  'description': 'A foreign word used instead of an Icelandic one'},
 'ice4fw': {'category': 'style',
  'subcategory': 'style',
  'description': 'An Icelandic word used instead of a foreign one'},
 'it4nonit': {'category': 'style',
  'subcategory': 'style',
  'description': 'A word in italic font which should be non-italic'},
 'nonit4it': {'category': 'style',
  'subcategory': 'style',
  'description': 'A word in non-italic font which should be italic'},
 'style': {'category': 'style',
  'subcategory': 'style',
  'description': 'A particular style in writing used'},
 'taboo-word': {'category': 'style',
  'subcategory': 'style',
  'description': 'An inappropriate word used'},
 'unicelandic': {'category': 'style',
  'subcategory': 'style',
  'description': 'Unicelandic usage in a sentence'},
 'wording': {'category': 'style',
  'subcategory': 'wording',
  'description': 'Various errors regarding wording'},
 'aux': {'category': 'vocabulary',
  'subcategory': 'aux',
  'description': 'Auxiliary verbs used incorrectly'},
 'have': {'category': 'vocabulary',
  'subcategory': 'aux',
  'description': 'Confusion in the use of ‘hafa’, ‘eiga’ and ‘vera með’'},
 'collocation': {'category': 'vocabulary',
  'subcategory': 'collocation',
  'description': 'An error in a collocation'},
 'collocation-idiom': {'category': 'vocabulary',
  'subcategory': 'collocation',
  'description': 'An error in a collocation with an opaque meaning'},
 'though': {'category': 'vocabulary',
  'subcategory': 'collocation',
  'description': "Confusion between 'þó að' and 'þótt'"},
 'extra-word': {'category': 'vocabulary',
  'subcategory': 'insertion',
  'description': 'A redundant word'},
 'extra-words': {'category': 'vocabulary',
  'subcategory': 'insertion',
  'description': 'More than one redundant word'},
 'repeat-word': {'category': 'vocabulary',
  'subcategory': 'insertion',
  'description': 'A word repeated just after the other'},
 'repeat-word-split': {'category': 'vocabulary',
  'subcategory': 'insertion',
  'description': 'A word repeated with some other words in between'},
 'adj4noun': {'category': 'vocabulary',
  'subcategory': 'lexical',
  'description': 'An adjective used where a noun should be used'},
 'context': {'category': 'vocabulary',
  'subcategory': 'lexical',
  'description': 'An incorrect word chosen for the particular context'},
 'noun4adj': {'category': 'vocabulary',
  'subcategory': 'lexical',
  'description': 'A noun used where an adjective should be used'},
 'það4þar': {'category': 'vocabulary',
  'subcategory': 'lexical',
  'description': 'það í stað þar'},
 'þar4það': {'category': 'vocabulary',
  'subcategory': 'lexical',
  'description': 'The adverb ‘þar’ used where ‘það’ should be'},
 'missing-word': {'category': 'vocabulary',
  'subcategory': 'omission',
  'description': 'A word missing'},
 'missing-words': {'category': 'vocabulary',
  'subcategory': 'omission',
  'description': 'More than one word missing'},
 'indef-pro': {'category': 'vocabulary',
  'subcategory': 'pro',
  'description': 'An indefinite pronoun used incorrectly'},
 'interr-pro': {'category': 'vocabulary',
  'subcategory': 'pro',
  'description': 'An incorrect interrogative pronoun used'},
 'plural4singular': {'category': 'vocabulary',
  'subcategory': 'semantic',
  'description': 'A plural word which should be singular'},
 'singular4plural': {'category': 'vocabulary',
  'subcategory': 'semantic',
  'description': 'A singular word which should be plural'}}



_DESCRIPTION = """The Icelandic Error Corpus (IceEC) is a collection of texts in modern Icelandic annotated for mistakes related to spelling, grammar, and other issues. The texts are organized by genre. The current version includes sentences from student essays, online news texts and Wikipedia articles.
Sentences within texts in the student essays had to be shuffled due to the license which they were originally published under, but neither the online news texts nor the Wikipedia articles needed to be shuffled.
"""
_CITATION = "Anton Karl Ingason, Lilja Björk Stefánsdóttir, Þórunn Arnardóttir, and Xindan Xu. 2021. The Icelandic Error Corpus (IceEC). Version 1.1. (https://github.com/antonkarl/iceErrorCorpus)"

import json

import datasets
from dataclasses import dataclass


@dataclass
class IceECConfig(datasets.BuilderConfig):
    """BuilderConfig for IceEC."""
    level: str = None


_URL = "https://huggingface.co/datasets/mideind/icelandic-error-corpus-IceEC/resolve/main"
_URLS = {
    "train": _URL + "/train.json" ,
    "test": _URL + "/test.json"
}


class IceEC(datasets.GeneratorBasedBuilder):
    """The Icelandic Error Corpus, IceEC."""

    BUILDER_CONFIGS = [
        IceECConfig(
            name="fine-grained",
            level=None,
            description="Load the IEC using fine grained information",
        ),
        IceECConfig(
            name="subcategory",
            level="subcategory",
            description="Load the IEC using subcategories",
        ),
        IceECConfig(
            name="category",
            level="category",
            description="Load the IEC using top level categories",
        ),

    ]


    def _info(self):
        return datasets.DatasetInfo(
            description=_DESCRIPTION,
            features=datasets.Features(
                {
                    "idx": datasets.Value("string"),
                    "sentence": datasets.Sequence(datasets.Value("string")),
                    "errors": datasets.Sequence(datasets.Sequence(datasets.Value("string"))),
                    "has_error": datasets.Value("bool"),
                    "corrected_sentence": datasets.Sequence(datasets.Value("string")),
                }
            ),
            # No default supervised_keys (as we have to pass both question
            # and context as input).
            supervised_keys=None,
            homepage="",
            citation=_CITATION,
        )

    def _split_generators(self, dl_manager):
        downloaded_files = dl_manager.download_and_extract(_URLS)

        return [
            datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
            datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
        ]

    def _generate_examples(self, filepath):
        with open(filepath, encoding="utf-8") as f:
            for line in f:
                data = json.loads(line.strip())
                if self.config.level is not None:
                    errors = []
                    for word_errors in data["errors"]:
                        errors.append([ERROR_INFORMATION[e][self.config.level] for e in word_errors])
                    data["errors"] = errors
                yield data["idx"], data