Datasets:
Tasks:
Text Generation
Modalities:
Text
Formats:
text
Sub-tasks:
language-modeling
Size:
< 1K
License:
Remove duplicates
Browse files- MemoriesProjectesLliures.tsv +2 -2
- raw/po-to-tsv.py +7 -5
MemoriesProjectesLliures.tsv
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:47c8d2fa65ad83027de73d59681534f6ef667aaa8ee6ca133c82d7ba1da7da20
|
| 3 |
+
size 82174469
|
raw/po-to-tsv.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import polib
|
| 2 |
import re
|
| 3 |
|
|
@@ -45,14 +46,15 @@ def generate_tsv(po_filename, output_filename):
|
|
| 45 |
input_po = polib.pofile(po_filename)
|
| 46 |
entries = 0
|
| 47 |
words = 0
|
|
|
|
| 48 |
|
| 49 |
with open(po_filename, "r") as source,\
|
| 50 |
open(output_filename, "w") as output:
|
| 51 |
|
| 52 |
for entry in input_po:
|
| 53 |
-
src = _remove_accelerators(entry.msgid)
|
| 54 |
-
trg = _remove_accelerators(entry.msgstr)
|
| 55 |
|
|
|
|
|
|
|
| 56 |
src = _remove_tags(src)
|
| 57 |
trg = _remove_tags(trg)
|
| 58 |
|
|
@@ -62,10 +64,10 @@ def generate_tsv(po_filename, output_filename):
|
|
| 62 |
if SEPARATOR in src or SEPARATOR in trg:
|
| 63 |
continue
|
| 64 |
|
| 65 |
-
src
|
| 66 |
-
|
| 67 |
-
|
| 68 |
|
|
|
|
| 69 |
output.write(f"{src}{SEPARATOR}{trg}\n")
|
| 70 |
words += len(src.split())
|
| 71 |
entries += 1
|
|
|
|
| 1 |
+
# (c) 2022 Jordi Mas i Herandèz. Licensed under GPL 3.0.
|
| 2 |
import polib
|
| 3 |
import re
|
| 4 |
|
|
|
|
| 46 |
input_po = polib.pofile(po_filename)
|
| 47 |
entries = 0
|
| 48 |
words = 0
|
| 49 |
+
srcs = set()
|
| 50 |
|
| 51 |
with open(po_filename, "r") as source,\
|
| 52 |
open(output_filename, "w") as output:
|
| 53 |
|
| 54 |
for entry in input_po:
|
|
|
|
|
|
|
| 55 |
|
| 56 |
+
src = _remove_accelerators(entry.msgid.strip())
|
| 57 |
+
trg = _remove_accelerators(entry.msgstr.strip())
|
| 58 |
src = _remove_tags(src)
|
| 59 |
trg = _remove_tags(trg)
|
| 60 |
|
|
|
|
| 64 |
if SEPARATOR in src or SEPARATOR in trg:
|
| 65 |
continue
|
| 66 |
|
| 67 |
+
if src in srcs:
|
| 68 |
+
continue
|
|
|
|
| 69 |
|
| 70 |
+
srcs.add(src)
|
| 71 |
output.write(f"{src}{SEPARATOR}{trg}\n")
|
| 72 |
words += len(src.split())
|
| 73 |
entries += 1
|