wiktionary_examples: drop quoted third-party lines, relabel CC BY-SA 4.0

#50
by ppuzio - opened
artifacts/source_findings.md CHANGED
@@ -1038,3 +1038,41 @@ say so in the datasheet instead of pretending a before/after can be regenerated.
1038
 
1039
  **Lesson:** a file name is metadata, not evidence. Two texts did not match the
1040
  work their file name gives, and 4 translator credits were wrong.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1038
 
1039
  **Lesson:** a file name is metadata, not evidence. Two texts did not match the
1040
  work their file name gives, and 4 translator credits were wrong.
1041
+
1042
+ ## wiktionary_examples — Polish Wiktionary usage examples (rebuild)
1043
+
1044
+ **Investigated** — 2026-10-05 (October 2026 rights audit, `artifacts/rights_audit_2026-10/reports/wikis_ugc.md`).
1045
+
1046
+ **Verdict** — `added`, rebuilt for v0.2.6. Quotations from third-party works dropped;
1047
+ 1,818 documents / 534,521 characters (v0.2.5: 8,639 / 2,889,761). Licence relabelled
1048
+ `CC-BY-SA-3.0` → `CC-BY-SA-4.0`.
1049
+
1050
+ **Enumeration** — official dump `plwiktionary-20261001-pages-articles.xml.bz2` (sha1
1051
+ `a097f6e2…`), parsed by `src/fetch_wiktionary_examples.py`. 116,157 Polish entries;
1052
+ 78,245 example lines, of which 32,664 carry `{{źródło}}`/`<ref>` and 319 name a source by
1053
+ hand ("(z Internetu)", "(B. Prus: Lalka)", "(Wikipedia)", Bible references, "(…)"). The
1054
+ audit's sample estimated 23% cited; the full count is 42%.
1055
+
1056
+ **License evidence** — verified: Wikimedia Terms of Use (contributors license their text
1057
+ CC BY-SA 4.0; page sha256 `913bdefc…`) and the pl.wiktionary footer linking BY-SA 4.0,
1058
+ both read 2026-10-05. Inferred: pre-June-2023 text was under 3.0, whose §4(b) allows an
1059
+ adaptation under 4.0. Quoted lines are used on Wiktionary under Art. 29, which does not
1060
+ pass to a corpus. Evidence in `data/wiktionary_examples/wiktionary_examples.license-evidence.json`.
1061
+
1062
+ **Blockers** — none to merge. Quotations pasted without a source marker cannot be
1063
+ detected; NERGAL pass before release.
1064
+
1065
+ **Unmarked-quotation sample** — kept (decided 2026-10-05) after a web check of 100 random
1066
+ released lines (seed 20261005, of 7,749): no line was found copied from another source
1067
+ (95% upper bound 3.7%). One line occurs on a 2017 forum post, copied from Wiktionary,
1068
+ where it has been since 2007; one is a paraphrase of a 2014 news quote, not verbatim.
1069
+ Web search cannot see unindexed print. Per line in
1070
+ `data/wiktionary_examples/wiktionary_examples.quotation-sample.jsonl`.
1071
+
1072
+ **200-character gate** — kept (decided 2026-10-05). It removes 29,265 of the 31,094
1073
+ entries with a kept example; several headwords per document is not done.
1074
+
1075
+ **Lesson** — (1) a template-only citation filter misses about 1% of quotations, which
1076
+ contributors attribute by hand in parentheses; survey the uncited lines before trusting
1077
+ it. (2) An end-of-section regex for `{{przykłady}}` must be anchored to line start, or an
1078
+ inline `{{tłum}}` cuts the section and hides cited lines.
data/wiktionary_examples/wiktionary_examples.license-evidence.json ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "license": "CC-BY-SA-4.0",
3
+ "spdx": "https://spdx.org/licenses/CC-BY-SA-4.0.html",
4
+ "status": "documented-open-cc-by-sa",
5
+ "review_scope": "licence of contributors' text on pl.wiktionary and removal of quoted third-party text; not independent legal advice",
6
+ "checked_at": "2026-10-05",
7
+ "evidence_url": "https://foundation.wikimedia.org/wiki/Policy:Terms_of_Use",
8
+ "sha256": "913bdefc49f13fbb3d12b5402712b10739cede9d6f4a76e7ad49f3304772b434",
9
+ "statement": "When you submit text to which you hold the copyright, you agree to license it under: Creative Commons Attribution-ShareAlike 4.0 International License (\"CC BY-SA 4.0\"), and GNU Free Documentation License (\"GFDL\")",
10
+ "site_footer": {
11
+ "url": "https://pl.wiktionary.org/wiki/dom",
12
+ "sha256": "14a12e875b9ab07f33586f43fb2f9b98eda42110963471917df7d6dd62cedc28",
13
+ "statement": "Tekst udostępniany na licencji Creative Commons: uznanie autorstwa, na tych samych warunkach, z możliwością obowiązywania dodatkowych ograniczeń.",
14
+ "license_link": "https://creativecommons.org/licenses/by-sa/4.0/deed.pl"
15
+ },
16
+ "chain": [
17
+ {
18
+ "hop": "Wiktionary contributors -> Wikimedia Foundation",
19
+ "basis": "Terms of Use: contributors license their text CC BY-SA 4.0 (CC BY-SA 3.0 before June 2023)",
20
+ "mark": "V"
21
+ },
22
+ {
23
+ "hop": "Wikimedia dump -> polish-dynaword",
24
+ "basis": "plwiktionary-20261001-pages-articles.xml.bz2, sha1 a097f6e2b005d1235936a19ed8e800e29a6f2fad, matched to the published dump checksum",
25
+ "url": "https://dumps.wikimedia.org/plwiktionary/20261001/",
26
+ "mark": "V"
27
+ },
28
+ {
29
+ "hop": "pre-June-2023 revisions under CC BY-SA 3.0 -> released as 4.0",
30
+ "basis": "CC BY-SA 3.0 §4(b) lets an adaptation be licensed under a later version with the same elements",
31
+ "url": "https://creativecommons.org/licenses/by-sa/3.0/legalcode",
32
+ "mark": "I"
33
+ }
34
+ ],
35
+ "attribution": "author = \"Wikisłownik contributors, <page URL>\"; the page history names the contributors (CC BY-SA 4.0 §3(a)(2) allows a URI)",
36
+ "finding": "Contributors' own usage examples are CC BY-SA 4.0. Quotations from third-party works (used on Wiktionary under the Art. 29 quotation right) are not, and are dropped: lines with {{źródło}}/<ref>, lines naming a source by hand, and excerpts marked (…).",
37
+ "release_scope": {
38
+ "pages_scanned": 869406,
39
+ "polish_entries": 116157,
40
+ "entries_with_examples": 31094,
41
+ "lines_dropped_cited": 32664,
42
+ "lines_dropped_hand_attributed": 319,
43
+ "lines_dropped_under_10_chars": 50,
44
+ "lines_kept": 45212,
45
+ "documents_200_chars_or_more": 1829,
46
+ "documents_released": 1818,
47
+ "dropped_duplicates": 11
48
+ },
49
+ "audit_trail": "wiktionary_examples.citations.jsonl, written by the fetcher next to its output, not part of the corpus: per entry, the sources of its dropped lines (199 dropped lines carry a citation marker with no source text)",
50
+ "quotation_sample": {
51
+ "file": "wiktionary_examples.quotation-sample.jsonl",
52
+ "checked_at": "2026-10-05",
53
+ "method": "random.seed(20261005); random.sample(non-empty lines of the released parquet in row order, 100); each line searched on the web as an exact phrase (the whole line or its most distinctive 10-15 words); a second span was searched when the first gave nothing conclusive, and for every line of rows 51-75; the file records the logged queries",
54
+ "seed": 20261005,
55
+ "lines_in_release": 7749,
56
+ "lines_sampled": 100,
57
+ "classes": {
58
+ "mirror_only": 44,
59
+ "none": 41,
60
+ "generic": 13,
61
+ "copied_from_wiktionary": 1,
62
+ "paraphrase_not_verbatim": 1
63
+ },
64
+ "quotations_found": 0,
65
+ "upper_bound_95": "3.7% of released lines (Wilson, 0/100)",
66
+ "limits": "web search only: printed or paywalled sources that are not indexed cannot match; the search engine does not strictly enforce exact-phrase queries"
67
+ },
68
+ "not_checked": [
69
+ "quotations pasted without any source marker: the filter cannot see them; a 100-line web sample found none (quotation_sample)",
70
+ "whether a contributor's example paraphrases a protected text",
71
+ "the 3.0 -> 4.0 relabel of pre-2023 text (inferred from 3.0 §4(b), not reviewed by a lawyer)",
72
+ "GFDL dual licensing; only the CC BY-SA grant is relied on",
73
+ "personal data in example sentences (NERGAL scrub runs before release)"
74
+ ]
75
+ }
data/wiktionary_examples/wiktionary_examples.md CHANGED
@@ -3,39 +3,100 @@
3
  Polish Wiktionary usage examples
4
 
5
  ## Dataset description
6
- - **Source (upstream):** https://dumps.wikimedia.org/plwiktionary/latest/
7
  - **Domain:** lexicographic
8
  - **Language:** Polish (pl)
9
- - **License:** `CC-BY-SA-3.0`
10
- - **Created (range):** 2004-03-22, 2026-08-15
11
- - **Added:** 2026-07-19
12
 
13
  ## Licensing — traceable basis
14
- Wikimedia dumps explicitly released under CC-BY-SA 3.0; attribution to contributors + share-alike preserved. Derived subset: usage-example sections from Polish-language entries only, grouped one document per headword.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  ## Provenance
17
- Parsed directly from the official Wikimedia dump (plwiktionary-latest-pages-articles.xml.bz2); not routed through SpeakLeash. Usage-example sections of Polish-language entries extracted and grouped one document per headword.
 
 
 
 
 
 
 
 
18
 
19
  ## Statistics
20
  | documents | characters | tokens (tiktoken proxy) |
21
  |---:|---:|---:|
22
- | 8,639 | 2,889,761 | 1,115,820 |
23
 
 
 
 
24
 
25
  ## Per-document license metadata
26
  | license | documents |
27
  |---|---:|
28
- | `CC-BY-SA-3.0` | 8,639 |
29
 
30
- Author metadata present for **8,639** documents. Empty values mean the upstream record did not expose a machine-readable author field.
31
 
32
  ## Filters applied (build_dynaword.py)
33
- Minimal, per Dynaword guidelines (heavy filtering left to downstream use):
34
- - drop documents < 200 chars: **0**
35
  - drop non-Polish (diacritic ratio): **0**
36
- - exact cross-source dedup (sha1): **481**
37
  - OCR alpha-ratio < 0.70 (OCR sources only): **0**
38
- - read 9,120 → kept 8,639
39
 
40
  Token counts are a fast tiktoken (cl100k) proxy (~1% off Llama-3); the canonical
41
  Llama-3 count is computed at release.
 
 
 
 
 
 
 
3
  Polish Wiktionary usage examples
4
 
5
  ## Dataset description
6
+ - **Source (upstream):** https://dumps.wikimedia.org/plwiktionary/20261001/
7
  - **Domain:** lexicographic
8
  - **Language:** Polish (pl)
9
+ - **License:** `CC-BY-SA-4.0`
10
+ - **Created (range):** 2004-03-22, 2026-10-01
11
+ - **Added:** 2026-07-19; rebuilt 2026-10-05 without quoted third-party text
12
 
13
  ## Licensing — traceable basis
14
+ Wiktionary contributors license their text under CC BY-SA 4.0: the Wikimedia
15
+ [Terms of Use](https://foundation.wikimedia.org/wiki/Policy:Terms_of_Use) (read
16
+ 2026-10-05) and the pl.wiktionary footer, which links
17
+ `creativecommons.org/licenses/by-sa/4.0/deed.pl`. Text contributed before June 2023
18
+ was under CC BY-SA 3.0, which allows an adaptation under a later version (3.0 §4(b)).
19
+ v0.2.5 labelled the source `CC-BY-SA-3.0`; this release labels it `CC-BY-SA-4.0`.
20
+
21
+ Not every example sentence is contributor text. Many are quotations from books,
22
+ press, the NKJP corpus, the web or Wikipedia, used on Wiktionary under the quotation
23
+ right (Art. 29 of the Polish copyright act). That right does not pass to a corpus,
24
+ and the CC BY-SA grant does not cover them. The fetcher drops them:
25
+
26
+ | line | lines | released |
27
+ |---|---:|---|
28
+ | carries `{{źródło}}` or a `<ref>` | 32,664 | no |
29
+ | names its source by hand, e.g. "(B. Prus: Lalka)", "(z Internetu)", "(Wikipedia)", "(Mt 4:19)", or is an excerpt marked "(…)" / "[…]" | 319 | no |
30
+ | shorter than 10 characters | 50 | no |
31
+ | contributor's own example | 45,212 | yes, if its entry reaches 200 characters |
32
+
33
+ The hand-attribution patterns come from a survey of the dump and also drop a few
34
+ lines that end in a Latin gloss in parentheses. Quotations pasted with no source
35
+ marker cannot be detected and may remain.
36
+
37
+ To measure them, 100 random released lines (of 7,749; `random.seed(20261005)`) were
38
+ searched on the web as exact phrases on 2026-10-05:
39
+
40
+ | result | lines |
41
+ |---|---:|
42
+ | found only on Wiktionary or sites that republish it | 44 |
43
+ | not found | 41 |
44
+ | too short or common for a match to mean copying | 13 |
45
+ | found elsewhere, copied *from* Wiktionary (2017 forum post; on Wiktionary since 2007) | 1 |
46
+ | paraphrase of a 2014 news quote, not verbatim | 1 |
47
+ | copied from another source | **0** |
48
+
49
+ 0 of 100 puts the share of unmarked quotations below 3.7% (95%, Wilson). Printed or
50
+ paywalled sources that search engines do not index cannot match. Per line:
51
+ `wiktionary_examples.quotation-sample.jsonl`. The source is kept (decided 2026-10-05).
52
+
53
+ Evidence: `wiktionary_examples.license-evidence.json`.
54
+
55
+ ## Attribution
56
+ Each row's `author` is `Wikisłownik contributors, <page URL>`, e.g.
57
+ `https://pl.wiktionary.org/wiki/czyta%C4%87`. The page history names the
58
+ contributors; CC BY-SA 4.0 §3(a)(2) allows attribution by a URI. The row `id` is
59
+ `wiktionary_examples_<page id>`.
60
 
61
  ## Provenance
62
+ Parsed from the official Wikimedia dump `plwiktionary-20261001-pages-articles.xml.bz2`
63
+ (sha1 `a097f6e2b005d1235936a19ed8e800e29a6f2fad`) by `src/fetch_wiktionary_examples.py`;
64
+ not routed through SpeakLeash. One document per Polish-language headword: the lines of
65
+ its `{{przykłady}}` section, in source order. The fetcher also writes
66
+ `wiktionary_examples.citations.jsonl` (not part of the corpus) listing, per entry, the
67
+ sources of the dropped lines.
68
+
69
+ 869,406 pages scanned → 116,157 Polish entries → 31,094 with at least one kept example
70
+ → 1,829 at 200 characters or more → 1,818 after deduplication.
71
 
72
  ## Statistics
73
  | documents | characters | tokens (tiktoken proxy) |
74
  |---:|---:|---:|
75
+ | 1,818 | 534,521 | 207,181 |
76
 
77
+ v0.2.5 had 8,639 documents (2,889,761 characters). Most of the drop comes from the
78
+ 200-character document gate: removing the quotations leaves most entries with one or
79
+ two short examples. The gate is kept (decided 2026-10-05).
80
 
81
  ## Per-document license metadata
82
  | license | documents |
83
  |---|---:|
84
+ | `CC-BY-SA-4.0` | 1,818 |
85
 
86
+ Author metadata present for **1,818** documents.
87
 
88
  ## Filters applied (build_dynaword.py)
89
+ - drop documents < 200 chars: **0** (the fetcher applies the same gate: 29,265 entries)
 
90
  - drop non-Polish (diacritic ratio): **0**
91
+ - exact cross-source dedup (sha1): **11**
92
  - OCR alpha-ratio < 0.70 (OCR sources only): **0**
93
+ - read 1,829 → kept 1,818
94
 
95
  Token counts are a fast tiktoken (cl100k) proxy (~1% off Llama-3); the canonical
96
  Llama-3 count is computed at release.
97
+
98
+ ## Not checked
99
+ - quotations pasted without any source marker beyond the 100-line web sample above
100
+ - whether an example paraphrases a protected text
101
+ - the 3.0 → 4.0 relabel of pre-2023 text (reading of 3.0 §4(b), not a lawyer's opinion)
102
+ - personal data in example sentences (the NERGAL scrub runs before release)
data/wiktionary_examples/wiktionary_examples.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:633427b261c1ae7524be43e5b0ecfbf673596ab6250a86a1304d69c975f0bd0d
3
- size 1646449
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:28a987798fc6f6d06cc64bad59e95236f821d20c88cecda37531cc4d6b3b26e6
3
+ size 306198
data/wiktionary_examples/wiktionary_examples.quotation-sample.jsonl ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"n": 1, "id": "wiktionary_examples_107109", "url": "https://pl.wiktionary.org/wiki/g%C5%82upi", "line": "Co za głupi film! Sama strzelanina i nie wiadomo, o co chodzi.", "queries": ["\"Co za głupi film! Sama strzelanina i nie wiadomo, o co chodzi.\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe-type mirror/dictionary pages surfaced in results (glosbe not fetched)"}
2
+ {"n": 2, "id": "wiktionary_examples_207981", "url": "https://pl.wiktionary.org/wiki/parzy%C4%87", "line": "Według tego przepisu szynkę należy parzyć przez półtorej godziny w temperaturze ok. 80°C.", "queries": ["\"szynkę należy parzyć przez półtorej godziny w temperaturze\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only the Wiktionary page itself or unrelated topical pages surfaced; second query: \"Według tego przepisu szynkę należy parzyć\""}
3
+ {"n": 3, "id": "wiktionary_examples_119355", "url": "https://pl.wiktionary.org/wiki/kana%C5%82", "line": "Dyrygent stanął za pulpitem w kanale orkiestrowym.", "queries": ["\"Dyrygent stanął za pulpitem w kanale orkiestrowym.\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only the Wiktionary page itself or unrelated topical pages surfaced"}
4
+ {"n": 4, "id": "wiktionary_examples_140530", "url": "https://pl.wiktionary.org/wiki/piek%C5%82o", "line": "Będziesz się smażył w piekle za swoje grzechy!", "queries": ["\"Będziesz się smażył w piekle za swoje grzechy!\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe-type mirror/dictionary pages surfaced in results (glosbe not fetched)"}
5
+ {"n": 5, "id": "wiktionary_examples_32949", "url": "https://pl.wiktionary.org/wiki/ani", "line": "Ani ta lista mi się nie podoba, ani nie imponuje, ale nie zostawiasz mi wyboru.", "queries": ["\"Ani ta lista mi się nie podoba, ani nie imponuje, ale nie zostawiasz mi wyboru.\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe-type mirror/dictionary pages surfaced in results (glosbe not fetched); second query: \"ani nie imponuje, ale nie zostawiasz mi wyboru\""}
6
+ {"n": 6, "id": "wiktionary_examples_7788", "url": "https://pl.wiktionary.org/wiki/jeden", "line": "W całym bloku tylko jeden mieszkaniec ma telefon.", "queries": ["\"W całym bloku tylko jeden mieszkaniec ma telefon.\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only the Wiktionary page itself or unrelated topical pages surfaced"}
7
+ {"n": 7, "id": "wiktionary_examples_209052", "url": "https://pl.wiktionary.org/wiki/og%C3%B3lny", "line": "Panuje wśród nich ogólna zawiść i nieufność.", "queries": ["\"Panuje wśród nich ogólna zawiść i nieufność.\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe-type mirror/dictionary pages surfaced in results (glosbe not fetched); second query: \"Panuje wśród nich ogólna zawiść\""}
8
+ {"n": 8, "id": "wiktionary_examples_199021", "url": "https://pl.wiktionary.org/wiki/sp%C4%99dza%C4%87", "line": "Tomek spędzał większość dnia w firmie.", "queries": ["\"Tomek spędzał większość dnia w firmie.\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only the Wiktionary page itself or unrelated topical pages surfaced; second query: \"spędzał większość dnia w firmie\""}
9
+ {"n": 9, "id": "wiktionary_examples_1977", "url": "https://pl.wiktionary.org/wiki/granat", "line": "W konserwatywnej szkole nadal obowiązują błękity i granaty.", "queries": ["\"W konserwatywnej szkole nadal obowiązują błękity i granaty.\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe-type mirror/dictionary pages surfaced in results (glosbe not fetched)"}
10
+ {"n": 10, "id": "wiktionary_examples_7541", "url": "https://pl.wiktionary.org/wiki/s%C5%82u%C5%BCy%C4%87", "line": "Nasz tata wszystkim służy dobrą radą.", "queries": ["\"Nasz tata wszystkim służy dobrą radą.\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only the Wiktionary page itself or unrelated topical pages surfaced; second query: \"Nasz tata wszystkim służy dobrą radą\" -wiktionary"}
11
+ {"n": 11, "id": "wiktionary_examples_18288", "url": "https://pl.wiktionary.org/wiki/wysoki", "line": "Mój chłopak jest wysoki, wyższy nawet od naszego nauczyciela historii.", "queries": ["\"Mój chłopak jest wysoki, wyższy nawet od naszego nauczyciela historii.\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only the Wiktionary page itself or unrelated topical pages surfaced; second query: \"Mój chłopak jest wysoki, wyższy nawet od naszego nauczyciela\""}
12
+ {"n": 12, "id": "wiktionary_examples_381823", "url": "https://pl.wiktionary.org/wiki/malta%C5%84czyk", "line": "W piątek na cmentarzu dla zwierząt pochowano maltańczyka Amora.", "queries": ["\"W piątek na cmentarzu dla zwierząt pochowano maltańczyka Amora.\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe-type mirror/dictionary pages surfaced in results (glosbe not fetched)"}
13
+ {"n": 13, "id": "wiktionary_examples_110625", "url": "https://pl.wiktionary.org/wiki/okazja", "line": "Dzisiaj nadarzyła się okazja do spotkania i porozmawiania.", "queries": ["\"Dzisiaj nadarzyła się okazja do spotkania i porozmawiania.\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe-type mirror/dictionary pages surfaced in results (glosbe not fetched)"}
14
+ {"n": 14, "id": "wiktionary_examples_205714", "url": "https://pl.wiktionary.org/wiki/zapis", "line": "Zapis matematyczny jest bardziej ścisły niż słowa.", "queries": ["\"Zapis matematyczny jest bardziej ścisły niż słowa.\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only the Wiktionary page itself or unrelated topical pages surfaced"}
15
+ {"n": 15, "id": "wiktionary_examples_109537", "url": "https://pl.wiktionary.org/wiki/r%C3%B3g", "line": "Ten żubr ma duże rogi.", "queries": ["\"Ten żubr ma duże rogi.\""], "class": "generic", "hit_url": null, "hit_kind": null, "note": "Too short/common or not a sentence; no external hit found in search results"}
16
+ {"n": 16, "id": "wiktionary_examples_464143", "url": "https://pl.wiktionary.org/wiki/burzliwy", "line": "Nie wypłynęliśmy w morze, bo pogoda była zbyt burzliwa.", "queries": ["\"Nie wypłynęliśmy w morze, bo pogoda była zbyt burzliwa.\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe-type mirror/dictionary pages surfaced in results (glosbe not fetched)"}
17
+ {"n": 17, "id": "wiktionary_examples_933426", "url": "https://pl.wiktionary.org/wiki/-cha", "line": "misa + -cha — micha", "queries": ["\"misa\" \"micha\" \"-cha\" sufiks"], "class": "generic", "hit_url": null, "hit_kind": null, "note": "Word-formation formula, not a sentence; no verbatim hit outside Wiktionary"}
18
+ {"n": 18, "id": "wiktionary_examples_148932", "url": "https://pl.wiktionary.org/wiki/%C5%BCal", "line": "Miałem wielki żal do rodziców za to, że zabronili mi jechać pod namiot.", "queries": ["\"Miałem wielki żal do rodziców za to, że zabronili mi jechać pod namiot.\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe-type mirror/dictionary pages surfaced in results (glosbe not fetched)"}
19
+ {"n": 19, "id": "wiktionary_examples_278277", "url": "https://pl.wiktionary.org/wiki/wyka%C5%82aczka", "line": "Istnieją specjalne, plastikowe wykałaczki do robienia koreczków, jednak ja wolę używać tych drewnianych, do zębów.", "queries": ["\"Istnieją specjalne, plastikowe wykałaczki do robienia koreczków, jednak ja wolę używać tych drewnianych, do zębów.\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe-type mirror/dictionary pages surfaced in results (glosbe not fetched)"}
20
+ {"n": 20, "id": "wiktionary_examples_143049", "url": "https://pl.wiktionary.org/wiki/Melchior", "line": "Mój stryjeczny dziadek ma na imię Melchior.", "queries": ["\"Mój stryjeczny dziadek ma na imię Melchior.\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only the Wiktionary page itself or unrelated topical pages surfaced"}
21
+ {"n": 21, "id": "wiktionary_examples_214931", "url": "https://pl.wiktionary.org/wiki/pionowo", "line": "Pięć pionowo: „Pasiaste zwierzę afrykańskie”. To chyba zebra, nie?", "queries": ["\"Pięć pionowo: „Pasiaste zwierzę afrykańskie”. To chyba zebra, nie?\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only the Wiktionary page itself or unrelated topical pages surfaced"}
22
+ {"n": 22, "id": "wiktionary_examples_366419", "url": "https://pl.wiktionary.org/wiki/Metis", "line": "Za radą Gai Zeus połknął Metis.", "queries": ["\"Za radą Gai Zeus połknął Metis.\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe-type mirror/dictionary pages surfaced in results (glosbe not fetched)"}
23
+ {"n": 23, "id": "wiktionary_examples_852463", "url": "https://pl.wiktionary.org/wiki/olbrzymka", "line": "Serbki pokonały Austriaczki, chociaż wśród nich same olbrzymki.", "queries": ["\"Serbki pokonały Austriaczki, chociaż wśród nich same olbrzymki.\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe-type mirror/dictionary pages surfaced in results (glosbe not fetched)"}
24
+ {"n": 24, "id": "wiktionary_examples_138031", "url": "https://pl.wiktionary.org/wiki/rysowa%C4%87", "line": "Myślę, że z tak dobrym wykształceniem rysuje się przed tobą świetlana przyszłość.", "queries": ["\"Myślę, że z tak dobrym wykształceniem rysuje się przed tobą świetlana przyszłość.\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe-type mirror/dictionary pages surfaced in results (glosbe not fetched)"}
25
+ {"n": 25, "id": "wiktionary_examples_88461", "url": "https://pl.wiktionary.org/wiki/translator", "line": "Chyba kupię ten mały, poręczny translator, działa szybko i daje zrozumiałe tłumaczenia.", "queries": ["\"Chyba kupię ten mały, poręczny translator, działa szybko i daje zrozumiałe tłumaczenia.\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe-type mirror/dictionary pages surfaced in results (glosbe not fetched)"}
26
+ {"n": 26, "id": "wiktionary_examples_935948", "url": "https://pl.wiktionary.org/wiki/zepchn%C4%85%C4%87", "line": "Zepchnął hulajnogę do rowu.", "queries": ["Zepchnął hulajnogę do rowu."], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only unrelated news about scooter/ditch incidents."}
27
+ {"n": 27, "id": "wiktionary_examples_617", "url": "https://pl.wiktionary.org/wiki/by%C4%87", "line": "Obiad zaraz będzie gotowy.", "queries": ["Obiad zaraz będzie gotowy."], "class": "generic", "hit_url": null, "hit_kind": null, "note": "Short everyday sentence; only recipe sites/reverso, no verbatim hit."}
28
+ {"n": 28, "id": "wiktionary_examples_940592", "url": "https://pl.wiktionary.org/wiki/siedemdziesi%C4%85t_sze%C5%9B%C4%87", "line": "Siedemdziesiąt sześć procent nastolatek twierdzi, że doceniłyby szczerą komunikację co do własnych cykli menstruacyjnych, lecz odczuwają, że miesiączki są w szkole zakazanym tematem.", "queries": ["Siedemdziesiąt sześć procent nastolatek twierdzi, że doceniłyby szczerą komunikację | doceniłyby szczerą komunikację co do własnych cykli menstruacyjnych"], "class": "mirror_only", "hit_url": "https://pl.wiktionary.org/wiki/verboten", "hit_kind": "wiktionary", "note": "Only pl.wiktionary 'verboten' entry (translation example, apparently from an English source not found); second query on 'doceniłyby szczerą komunikację...' gave the same."}
29
+ {"n": 29, "id": "wiktionary_examples_31922", "url": "https://pl.wiktionary.org/wiki/wyci%C4%85g", "line": "Staszek wypił cały wyciąg z owoców, z którego babcia chciała zrobić kompot.", "queries": ["Staszek wypił cały wyciąg z owoców, z którego babcia chciała zrobić kompot"], "class": "mirror_only", "hit_url": "https://pl.glosbe.com/pl/pl/wyci%C4%85g", "hit_kind": "glosbe mirror", "note": "Only pl.wiktionary (wyciąg, Staszek) and glosbe."}
30
+ {"n": 30, "id": "wiktionary_examples_135653", "url": "https://pl.wiktionary.org/wiki/lecie%C4%87", "line": "Wczoraj Igor jakoś tak dziwnie się popatrzył na Laurę. Dziewczyny już opowiadają, że on na nią leci.", "queries": ["Wczoraj Igor jakoś tak dziwnie się popatrzył na Laurę. Dziewczyny już opowiadają, że on na nią leci. | dziwnie się popatrzył na Laurę on na nią leci"], "class": "mirror_only", "hit_url": "https://pl.glosbe.com/pl/pl/lecie%C4%87", "hit_kind": "glosbe mirror", "note": "Only pl.wiktionary lecieć and glosbe; blog hits (Raura etc.) not verbatim in snippets (not fetched)."}
31
+ {"n": 31, "id": "wiktionary_examples_141501", "url": "https://pl.wiktionary.org/wiki/szmata", "line": "Sąd powinien zabrać dziecko tej szmacie.", "queries": ["Sąd powinien zabrać dziecko tej szmacie."], "class": "mirror_only", "hit_url": "https://pl.glosbe.com/pl/pl/szmata", "hit_kind": "glosbe mirror", "note": "Only pl.wiktionary szmata and glosbe."}
32
+ {"n": 32, "id": "wiktionary_examples_135653", "url": "https://pl.wiktionary.org/wiki/lecie%C4%87", "line": "Jak ci leci? Dawno się nie odzywałeś. — Jakoś leci.", "queries": ["Jak ci leci? Dawno się nie odzywałeś. — Jakoś leci."], "class": "generic", "hit_url": null, "hit_kind": null, "note": "Common greeting exchange; only wiktionary/glosbe/reverso, no verbatim external hit."}
33
+ {"n": 33, "id": "wiktionary_examples_112047", "url": "https://pl.wiktionary.org/wiki/%C5%9Bmierdzie%C4%87", "line": "Te dwie firmy na kilometr śmierdzą kreatywną księgowością.", "queries": ["Te dwie firmy na kilometr śmierdzą kreatywną księgowością."], "class": "mirror_only", "hit_url": "https://pl.glosbe.com/pl/pl/%C5%9Bmierdzie%C4%87", "hit_kind": "glosbe mirror", "note": "Only pl.wiktionary and glosbe."}
34
+ {"n": 34, "id": "wiktionary_examples_136501", "url": "https://pl.wiktionary.org/wiki/jakby", "line": "Czytając tę książkę, doznałem jakby olśnienia.", "queries": ["Czytając tę książkę, doznałem jakby olśnienia. | Czytając tę książkę, doznałem jakby olśnienia jakby"], "class": "copied_from_wiktionary", "hit_url": "https://hinative.com/questions/4736697", "hit_kind": "Q&A forum (HiNative) answer", "note": "On pl.wiktionary since revision 2007-12-27T19:52:51Z; the HiNative answer (2017-09-10) repeats it with Wiktionary's sense number (1.1)."}
35
+ {"n": 35, "id": "wiktionary_examples_106206", "url": "https://pl.wiktionary.org/wiki/Dominika", "line": "Wczoraj Dominika nie było w bibliotece.", "queries": ["Wczoraj Dominika nie było w bibliotece."], "class": "none", "hit_url": null, "hit_kind": null, "note": "Short sentence with name; no verbatim hit."}
36
+ {"n": 36, "id": "wiktionary_examples_119355", "url": "https://pl.wiktionary.org/wiki/kana%C5%82", "line": "Wezmę ten samochód do siebie na kanał i naprawię usterkę.", "queries": ["Wezmę ten samochód do siebie na kanał i naprawię usterkę."], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary kanał."}
37
+ {"n": 37, "id": "wiktionary_examples_32274", "url": "https://pl.wiktionary.org/wiki/ksi%C4%99%C5%BCyc", "line": "Śnieg iskrzył się w księżycu.", "queries": ["Śnieg iskrzył się w księżycu."], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary księżyc."}
38
+ {"n": 38, "id": "wiktionary_examples_4160", "url": "https://pl.wiktionary.org/wiki/j%C4%99zyk", "line": "Urwał mi się język u buta.", "queries": ["Urwał mi się język u buta."], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary język."}
39
+ {"n": 39, "id": "wiktionary_examples_534355", "url": "https://pl.wiktionary.org/wiki/bibu%C5%82a", "line": "Edka złapali z walizą bibuły, jak nic odsiedzi ze trzy lata.", "queries": ["Edka złapali z walizą bibuły, jak nic odsiedzi ze trzy lata. | Edka złapali z walizą bibuły"], "class": "mirror_only", "hit_url": "https://pl.glosbe.com/pl/pl/bibu%C5%82a", "hit_kind": "glosbe mirror", "note": "Only pl.wiktionary bibuła and glosbe; Kazik autobiography (scribd) result not confirmed verbatim."}
40
+ {"n": 40, "id": "wiktionary_examples_86794", "url": "https://pl.wiktionary.org/wiki/%C5%9Bwiat%C5%82o", "line": "Jacek trafił w światło bramki.", "queries": ["Jacek trafił w światło bramki."], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only book title 'Światło bramki' hits, not the sentence."}
41
+ {"n": 41, "id": "wiktionary_examples_504084", "url": "https://pl.wiktionary.org/wiki/egzaminacyjny", "line": "Każdy samochód egzaminacyjny wyposażony jest w szereg kamer wideo rejestrujących przebieg egzaminu państwowego na prawo jazdy.", "queries": ["Każdy samochód egzaminacyjny wyposażony jest w szereg kamer wideo rejestrujących przebieg egzaminu | samochód egzaminacyjny wyposażony jest w szereg kamer wideo"], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary egzaminacyjny; news on exam car cameras not verbatim."}
42
+ {"n": 42, "id": "wiktionary_examples_34153", "url": "https://pl.wiktionary.org/wiki/mors", "line": "Na rejs do Malmö potrzebujemy morsa do załogi.", "queries": ["Na rejs do Malmö potrzebujemy morsa do załogi."], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary mors and glosbe/dictionaries24 headword pages."}
43
+ {"n": 43, "id": "wiktionary_examples_99989", "url": "https://pl.wiktionary.org/wiki/oko%C5%82o", "line": "Wrócił około północy.", "queries": ["Wrócił około północy."], "class": "generic", "hit_url": null, "hit_kind": null, "note": "Very short common sentence; no verbatim hit."}
44
+ {"n": 44, "id": "wiktionary_examples_124195", "url": "https://pl.wiktionary.org/wiki/jedyny", "line": "Jesteś dla mnie jedyny.", "queries": ["Jesteś dla mnie jedyny."], "class": "generic", "hit_url": null, "hit_kind": null, "note": "Very short common sentence; only song titles with feminine variant."}
45
+ {"n": 45, "id": "wiktionary_examples_244489", "url": "https://pl.wiktionary.org/wiki/wiadomo", "line": "Nie wiadomo, co było później.", "queries": ["Nie wiadomo, co było później. | Nie wiadomo, co było później -wiktionary"], "class": "generic", "hit_url": null, "hit_kind": null, "note": "Short common sentence; only pl.wiktionary wiadomo; no external hit (second query with -wiktionary also empty)."}
46
+ {"n": 46, "id": "wiktionary_examples_374416", "url": "https://pl.wiktionary.org/wiki/winobranie", "line": "Ze stryjem udaliśmy się wczesnym rankiem na winobranie.", "queries": ["Ze stryjem udaliśmy się wczesnym rankiem na winobranie."], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary winobranie."}
47
+ {"n": 47, "id": "wiktionary_examples_534040", "url": "https://pl.wiktionary.org/wiki/latynizacja", "line": "Istnieją dwie powszechnie używane latynizacje pisma chińskiego: system Wade’a-Gilesa oraz pinyin.", "queries": ["Istnieją dwie powszechnie używane latynizacje pisma chińskiego: system Wade’a-Gilesa oraz pinyin | dwie powszechnie używane latynizacje pisma chińskiego"], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary latynizacja; pl.wikipedia articles on pinyin/Wade-Giles show similar topic, not confirmed as verbatim."}
48
+ {"n": 48, "id": "wiktionary_examples_198978", "url": "https://pl.wiktionary.org/wiki/oaza", "line": "Na piątkowej oazie animatorka omówiła kolejny krok.", "queries": ["Na piątkowej oazie animatorka omówiła kolejny krok."], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary oaza."}
49
+ {"n": 49, "id": "wiktionary_examples_372191", "url": "https://pl.wiktionary.org/wiki/ma%C5%82y_palec", "line": "Magazynierka oparła się o regał tak nieszczęśliwie, że kompletnie wywichnęła sobie mały palec u prawej dłoni.", "queries": ["Magazynierka oparła się o regał tak nieszczęśliwie, że kompletnie wywichnęła sobie mały palec | kompletnie wywichnęła sobie mały palec u prawej dłoni"], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary mały palec/nieszczęśliwie/magazynierka."}
50
+ {"n": 50, "id": "wiktionary_examples_537105", "url": "https://pl.wiktionary.org/wiki/chrzcielny", "line": "Ksiądz zaintonował litanię chrzcielną.", "queries": ["Ksiądz zaintonował litanię chrzcielną."], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary chrzcielny."}
51
+ {"n": 51, "id": "wiktionary_examples_177642", "url": "https://pl.wiktionary.org/wiki/przegry%C5%BA%C4%87", "line": "Szczury przegryzły się przez drzwi do garażu.", "queries": ["\"Szczury przegryzły się przez drzwi do garażu.\"", "\"przegryzły się przez drzwi do garażu\" szczury"], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary (or unrelated pages) in results; no verbatim hit elsewhere. | second query: none; Only pl.wiktionary plus unrelated rat-control articles."}
52
+ {"n": 52, "id": "wiktionary_examples_88801", "url": "https://pl.wiktionary.org/wiki/Jakub", "line": "Poszedłem z Jakubem do wesołego miasteczka.", "queries": ["\"Poszedłem z Jakubem do wesołego miasteczka.\"", "\"Poszedłem z Jakubem do wesołego miasteczka\""], "class": "generic", "hit_url": null, "hit_kind": null, "note": "Short/common sentence; no verbatim hit outside Wiktionary. | second query: generic; Only pl.wiktionary (Jakub); short/common."}
53
+ {"n": 53, "id": "wiktionary_examples_858", "url": "https://pl.wiktionary.org/wiki/siostra", "line": "„Siostro, basen, szybko!”", "queries": ["\"„Siostro, basen, szybko!”\"", "\"Siostro, basen, szybko\" siostro"], "class": "generic", "hit_url": null, "hit_kind": null, "note": "Short exclamation; only Wiktionary plus unrelated 'Siostro, basen!' comic/episode/meme titles; no verbatim sentence elsewhere. | second query: generic; Short exclamation; only Wiktionary and unrelated meme/comic/series titles."}
54
+ {"n": 54, "id": "wiktionary_examples_486637", "url": "https://pl.wiktionary.org/wiki/wst%C4%99powa%C4%87", "line": "We wtorki po szkole wstępuję do babci.", "queries": ["\"We wtorki po szkole wstępuję do babci.\"", "\"po szkole wstępuję do babci\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe (Wiktionary mirror) in results; no independent source. | second query: none; No Wiktionary or verbatim hit; unrelated pages."}
55
+ {"n": 55, "id": "wiktionary_examples_467296", "url": "https://pl.wiktionary.org/wiki/zarz%C4%85dzenie", "line": "W naszej firmie obowiązuje niepisane zarządzenie prezesa, żeby z dziennikarzami nie rozmawiać.", "queries": ["\"W naszej firmie obowiązuje niepisane zarządzenie prezesa, żeby z dziennikarzami nie rozmawiać.\"", "\"niepisane zarządzenie prezesa\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe (Wiktionary mirror) in results; no independent source. | second query: mirror_only; pl.wiktionary and glosbe only; other hits are unrelated legal/BIP pages."}
56
+ {"n": 56, "id": "wiktionary_examples_41021", "url": "https://pl.wiktionary.org/wiki/obrona", "line": "Po strzeleniu gola drużyna gości cofnęła się na swoją połowę i ograniczyła tylko do obrony.", "queries": ["\"Po strzeleniu gola drużyna gości cofnęła się na swoją połowę i ograniczyła tylko do obrony.\"", "\"cofnęła się na swoją połowę i ograniczyła tylko do obrony\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe (Wiktionary mirror) in results; no independent source. | second query: mirror_only; glosbe and wedariusz.pl (dictionary page for obrona, Wiktionary-derived); rest unrelated books."}
57
+ {"n": 57, "id": "wiktionary_examples_198522", "url": "https://pl.wiktionary.org/wiki/murzyn", "line": "Całkiem zwyczajnie, jako bogata z domu, opłaciła jakiegoś murzyna, który za nią napisał tę pracę semestralną.", "queries": ["\"Całkiem zwyczajnie, jako bogata z domu, opłaciła jakiegoś murzyna, który za nią napisał\"", "\"opłaciła jakiegoś murzyna, który za nią napisał tę pracę semestralną\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary (or unrelated pages) in results; no verbatim hit elsewhere. | second query: none; Only pl.wiktionary; others are unrelated ghostwriting articles/forums."}
58
+ {"n": 58, "id": "wiktionary_examples_164345", "url": "https://pl.wiktionary.org/wiki/rada", "line": "Dam ci dobrą radę! Trzymaj się z dala od mojej dziewczyny!", "queries": ["\"Dam ci dobrą radę! Trzymaj się z dala od mojej dziewczyny!\"", "\"Trzymaj się z dala od mojej dziewczyny\" \"Dam ci dobrą radę\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary (or unrelated pages) in results; no verbatim hit elsewhere. | second query: none; Only pl.wiktionary; others unrelated."}
59
+ {"n": 59, "id": "wiktionary_examples_272442", "url": "https://pl.wiktionary.org/wiki/utrzymanie", "line": "Opiekował się staruszką w zamian za utrzymanie.", "queries": ["\"Opiekował się staruszką w zamian za utrzymanie.\"", "\"Opiekował się staruszką w zamian za utrzymanie\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe (Wiktionary mirror) in results; no independent source. | second query: mirror_only; pl.wiktionary and glosbe only; others unrelated legal/news pages."}
60
+ {"n": 60, "id": "wiktionary_examples_23214", "url": "https://pl.wiktionary.org/wiki/zapomnie%C4%87", "line": "Znany piłkarz w trakcie ostrej telewizyjnej dyskusji zapomniał się i sklął jednego z gości.", "queries": ["\"Znany piłkarz w trakcie ostrej telewizyjnej dyskusji zapomniał się i sklął jednego z gości.\"", "\"zapomniał się i sklął jednego z gości\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe (Wiktionary mirror) in results; no independent source. | second query: mirror_only; pl.wiktionary, glosbe, wedariusz.pl (dictionary mirror); books returned are unrelated."}
61
+ {"n": 61, "id": "wiktionary_examples_144231", "url": "https://pl.wiktionary.org/wiki/%C5%81ucja", "line": "Mam na imię Łucja i jestem aktorką z Wrocławia.", "queries": ["\"Mam na imię Łucja i jestem aktorką z Wrocławia.\"", "\"i jestem aktorką z Wrocławia\" \"Mam na imię Łucja\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe (Wiktionary mirror) in results; no independent source. | second query: none; Only pages about actress Łucja Burzyńska; no sentence match."}
62
+ {"n": 62, "id": "wiktionary_examples_543916", "url": "https://pl.wiktionary.org/wiki/oprzyrz%C4%85dowanie", "line": "Maszyna posiada kompletne oprzyrządowanie: główkę podwójnie skrętną, główkę do dłutowania, dwa okulary, podzielnicę, konik do podzielnicy, gitarę, imadło, trzpienie i tulejki.", "queries": ["\"Maszyna posiada kompletne oprzyrządowanie: główkę podwójnie skrętną, główkę do dłutowania, dwa okulary, podzielnicę,\"", "\"główkę do dłutowania, dwa okulary, podzielnicę, konik do podzielnicy, gitarę, imadło, trzpienie i tulejki\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe (Wiktionary mirror) in results; no independent source. | second query: mirror_only; pl.wiktionary and glosbe; machine-tool shop listings do not show the sentence in results."}
63
+ {"n": 63, "id": "wiktionary_examples_210963", "url": "https://pl.wiktionary.org/wiki/psu%C4%87", "line": "Opinia ludzi na temat rządu psuje się zawsze z biegiem czasu.", "queries": ["\"Opinia ludzi na temat rządu psuje się zawsze z biegiem czasu.\"", "\"Opinia ludzi na temat rządu psuje się zawsze z biegiem czasu\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary (or unrelated pages) in results; no verbatim hit elsewhere. | second query: none; Only pl.wiktionary; others are unrelated polling articles."}
64
+ {"n": 64, "id": "wiktionary_examples_126629", "url": "https://pl.wiktionary.org/wiki/kierowa%C4%87", "line": "Mój ojciec kieruje zespołem pięciu ludzi.", "queries": ["\"Mój ojciec kieruje zespołem pięciu ludzi.\"", "\"Mój ojciec kieruje zespołem pięciu ludzi\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary (or unrelated pages) in results; no verbatim hit elsewhere. | second query: none; No Wiktionary or verbatim hit; unrelated pages."}
65
+ {"n": 65, "id": "wiktionary_examples_134732", "url": "https://pl.wiktionary.org/wiki/wisie%C4%87", "line": "Helikopter wisi nieruchomo trzydzieści metrów nad ziemią.", "queries": ["\"Helikopter wisi nieruchomo trzydzieści metrów nad ziemią.\"", "\"wisi nieruchomo trzydzieści metrów nad ziemią\" helikopter"], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe (Wiktionary mirror) in results; no independent source. | second query: mirror_only; pl.wiktionary and glosbe only; others unrelated."}
66
+ {"n": 66, "id": "wiktionary_examples_93805", "url": "https://pl.wiktionary.org/wiki/sens", "line": "Nie widzę sensu w swoim życiu.", "queries": ["\"Nie widzę sensu w swoim życiu.\"", "\"Nie widzę sensu w swoim życiu\" Nie widzę sensu"], "class": "generic", "hit_url": null, "hit_kind": null, "note": "Short/common sentence; no verbatim hit outside Wiktionary. | second query: generic; Common phrase; hits are self-help articles on the topic, not the sentence."}
67
+ {"n": 67, "id": "wiktionary_examples_99095", "url": "https://pl.wiktionary.org/wiki/uwa%C5%BCa%C4%87", "line": "Uważałem cię zawsze za swojego przyjaciela.", "queries": ["\"Uważałem cię zawsze za swojego przyjaciela.\"", "\"Uważałem cię zawsze za swojego przyjaciela\" uważałem"], "class": "generic", "hit_url": null, "hit_kind": null, "note": "Short/common sentence; no verbatim hit outside Wiktionary. | second query: generic; Common phrase; only Wiktionary plus lyrics sites (not the sentence)."}
68
+ {"n": 68, "id": "wiktionary_examples_4734", "url": "https://pl.wiktionary.org/wiki/zero", "line": "Trzy plus zero równa się trzy.", "queries": ["\"Trzy plus zero równa się trzy.\"", "\"Trzy plus zero równa się trzy\" plus"], "class": "generic", "hit_url": null, "hit_kind": null, "note": "Short/common sentence; no verbatim hit outside Wiktionary. | second query: generic; Trivial arithmetic sentence; only Wiktionary plus unrelated math pages."}
69
+ {"n": 69, "id": "wiktionary_examples_240763", "url": "https://pl.wiktionary.org/wiki/wskutek", "line": "Wskutek czołowego zderzenia samochodu ciężarowego z autem osobowym na trasie drogi krajowej nr 7 koło Olsztynka zginęły trzy osoby. Wśród ofiar śmiertelnych znalazł się kierowca samochodu osobowego i dwóch jego pasażerów.", "queries": ["\"Wskutek czołowego zderzenia samochodu ciężarowego z autem osobowym na trasie drogi krajowej nr\"", "\"zginęły trzy osoby. Wśród ofiar śmiertelnych znalazł się kierowca samochodu osobowego i dwóch jego pasażerów\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Search listed pl.wiktionary and glosbe; news results about S7/DK7 crashes near Olsztynek are different texts, no verbatim match (PAP page fetch returned empty). | second query: none; Only news reports of different crashes (2026); no verbatim match."}
70
+ {"n": 70, "id": "wiktionary_examples_1970", "url": "https://pl.wiktionary.org/wiki/golf", "line": "Golfa rozgrywa się na stole do ósemki.", "queries": ["\"Golfa rozgrywa się na stole do ósemki.\"", "\"Golfa rozgrywa się na stole do ósemki\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe (Wiktionary mirror) in results; no independent source. | second query: mirror_only; pl.wiktionary, glosbe, slowka.info (aggregator); others unrelated."}
71
+ {"n": 71, "id": "wiktionary_examples_276769", "url": "https://pl.wiktionary.org/wiki/toczy%C4%87", "line": "Toczę wino z beczki.", "queries": ["\"Toczę wino z beczki.\"", "\"Toczę wino z beczki\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary (or unrelated pages) in results; no verbatim hit elsewhere. | second query: none; Only unrelated wine/barrel articles."}
72
+ {"n": 72, "id": "wiktionary_examples_4160", "url": "https://pl.wiktionary.org/wiki/j%C4%99zyk", "line": "Krowy mają długie języki.", "queries": ["\"Krowy mają długie języki.\"", "\"Krowy mają długie języki\" krowy"], "class": "generic", "hit_url": null, "hit_kind": null, "note": "Short/common sentence; no verbatim hit outside Wiktionary. | second query: generic; Short/common; only unrelated cow-fact pages."}
73
+ {"n": 73, "id": "wiktionary_examples_146482", "url": "https://pl.wiktionary.org/wiki/przedstawia%C4%87", "line": "Sytuacja w firmie nie przedstawia się najlepiej, w ostatnim kwartale mieliśmy duże straty.", "queries": ["\"Sytuacja w firmie nie przedstawia się najlepiej, w ostatnim kwartale mieliśmy duże straty.\"", "\"w ostatnim kwartale mieliśmy duże straty\" \"nie przedstawia się najlepiej\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary (or unrelated pages) in results; no verbatim hit elsewhere. | second query: none; Only unrelated financial news."}
74
+ {"n": 74, "id": "wiktionary_examples_4979", "url": "https://pl.wiktionary.org/wiki/katalog", "line": "Piotr zamówił zestaw szwedzkich mebli z katalogu.", "queries": ["\"Piotr zamówił zestaw szwedzkich mebli z katalogu.\"", "\"zamówił zestaw szwedzkich mebli z katalogu\""], "class": "mirror_only", "hit_url": null, "hit_kind": null, "note": "Only pl.wiktionary and glosbe (Wiktionary mirror) in results; no independent source. | second query: none; Only pl.wiktionary plus unrelated furniture shops."}
75
+ {"n": 75, "id": "wiktionary_examples_4399", "url": "https://pl.wiktionary.org/wiki/garowa%C4%87", "line": "Zbychowi, który za damski chuj garuje już prawie dwa roki, zostały do odsiadki ledwie trzy miechy.", "queries": ["\"Zbychowi, który za damski chuj garuje już prawie dwa roki, zostały do odsiadki\"", "\"zostały do odsiadki ledwie trzy miechy\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Only Wiktionary; other hits are the Sobota song 'Za damski chuj' and slang glossaries, not this sentence. | second query: none; Only pl.wiktionary plus unrelated prison/forum pages."}
76
+ {"n": 76, "id": "wiktionary_examples_683395", "url": "https://pl.wiktionary.org/wiki/w_sensie", "line": "Musimy wyremontować kuchnię, łazienkę, dwa pokoje i korytarz, w sensie – całe mieszkanie.", "queries": ["\"Musimy wyremontować kuchnię, łazienkę, dwa pokoje i korytarz, w sensie – całe mieszkanie.\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "No verbatim hit in two query attempts"}
77
+ {"n": 77, "id": "wiktionary_examples_276769", "url": "https://pl.wiktionary.org/wiki/toczy%C4%87", "line": "Gruźlica toczy ciało chorego.", "queries": ["\"Gruźlica toczy ciało chorego.\""], "class": "mirror_only", "hit_url": "https://pl.wiktionary.org/wiki/toczy%C4%87", "hit_kind": "wiktionary", "note": "Only Wiktionary page found on both queries"}
78
+ {"n": 78, "id": "wiktionary_examples_144890", "url": "https://pl.wiktionary.org/wiki/ci%C4%85g", "line": "W mieście wyburzono całe ciągi zabytkowych budynków.", "queries": ["\"W mieście wyburzono całe ciągi zabytkowych budynków.\""], "class": "mirror_only", "hit_url": "https://pl.glosbe.com/pl/pl/ci%C4%85g", "hit_kind": "wiktionary mirror", "note": "Only Wiktionary ciąg page and glosbe"}
79
+ {"n": 79, "id": "wiktionary_examples_944317", "url": "https://pl.wiktionary.org/wiki/czterdziestkasi%C3%B3demka", "line": "Na odświeżanym w czasie rzeczywistym podglądzie zaworów wyraźnie widać, że to czterdziestkasiódemka szwankuje.", "queries": ["\"Na odświeżanym w czasie rzeczywistym podglądzie zaworów wyraźnie widać, że to czterdziestkasiódemka szwankuje.\""], "class": "mirror_only", "hit_url": "https://pl.wiktionary.org/wiki/szwankowa%C4%87", "hit_kind": "wiktionary", "note": "Wiktionary szwankować page surfaced; sibling of n=95 (template-like numeral line)"}
80
+ {"n": 80, "id": "wiktionary_examples_5089", "url": "https://pl.wiktionary.org/wiki/zapisywa%C4%87", "line": "Czy zapisałeś godziny odjazdów pociągów?", "queries": ["\"Czy zapisałeś godziny odjazdów pociągów?\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "No verbatim hit in two query attempts"}
81
+ {"n": 81, "id": "wiktionary_examples_943556", "url": "https://pl.wiktionary.org/wiki/siedemdziesi%C4%85ty_dziewi%C4%85ty", "line": "Podejrzewam, że ktoś celowo wprowadził błąd do sześćset siedemdziesiątego dziewiątego wiersza kodu.", "queries": ["\"Podejrzewam, że ktoś celowo wprowadził błąd do sześćset siedemdziesiątego dziewiątego wiersza kodu.\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "No verbatim hit in two query attempts"}
82
+ {"n": 82, "id": "wiktionary_examples_320644", "url": "https://pl.wiktionary.org/wiki/skrajny", "line": "Ten skrajny słupek na parkingu często jest przewracany przez nieostrożnych kierowców.", "queries": ["\"Ten skrajny słupek na parkingu często jest przewracany przez nieostrożnych kierowców.\""], "class": "mirror_only", "hit_url": "https://pl.glosbe.com/pl/pl/skrajny", "hit_kind": "wiktionary mirror", "note": "Wiktionary + glosbe only"}
83
+ {"n": 83, "id": "wiktionary_examples_61612", "url": "https://pl.wiktionary.org/wiki/Mars", "line": "Mars ma 2 księżyce, które mają nieregularny kształt.", "queries": ["\"Mars ma 2 księżyce, które mają nieregularny kształt.\""], "class": "mirror_only", "hit_url": "https://pl.m.wiktionary.org/wiki/Mars", "hit_kind": "wiktionary", "note": "Only Wiktionary Mars page; Wikipedia etc. say same fact but not same sentence"}
84
+ {"n": 84, "id": "wiktionary_examples_216289", "url": "https://pl.wiktionary.org/wiki/komplet", "line": "Ile kosztuje komplet podręczników do piątej klasy?", "queries": ["\"Ile kosztuje komplet podręczników do piątej klasy?\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "No verbatim hit in two query attempts"}
85
+ {"n": 85, "id": "wiktionary_examples_486637", "url": "https://pl.wiktionary.org/wiki/wst%C4%99powa%C4%87", "line": "Wstępowała w nich nadzieja, gdy tylko było z oddali słychać dźwięk dzwonów.", "queries": ["\"Wstępowała w nich nadzieja, gdy tylko było z oddali słychać dźwięk dzwonów.\""], "class": "mirror_only", "hit_url": "https://pl.glosbe.com/pl/pl/wst%C4%99powa%C4%87", "hit_kind": "wiktionary mirror", "note": "Wiktionary + glosbe only; wikisource hits were topical, not verbatim"}
86
+ {"n": 86, "id": "wiktionary_examples_176232", "url": "https://pl.wiktionary.org/wiki/klatka", "line": "Nagle poczułem dziwne kłucie w klatce.", "queries": ["\"Nagle poczułem dziwne kłucie w klatce.\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "No verbatim hit in two query attempts"}
87
+ {"n": 87, "id": "wiktionary_examples_514230", "url": "https://pl.wiktionary.org/wiki/praktycznie", "line": "Podszedł do rzeczy bardzo praktycznie.", "queries": ["\"Podszedł do rzeczy bardzo praktycznie.\""], "class": "mirror_only", "hit_url": "https://pl.wiktionary.org/wiki/praktycznie", "hit_kind": "wiktionary", "note": "Only Wiktionary"}
88
+ {"n": 88, "id": "wiktionary_examples_205572", "url": "https://pl.wiktionary.org/wiki/przeci%C4%99tny", "line": "Przeciętnej polskiej rodziny nie stać na kredyt.", "queries": ["\"Przeciętnej polskiej rodziny nie stać na kredyt.\""], "class": "mirror_only", "hit_url": "https://pl.glosbe.com/pl/pl/przeci%C4%99tny", "hit_kind": "wiktionary mirror", "note": "Wiktionary + glosbe only"}
89
+ {"n": 89, "id": "wiktionary_examples_4986", "url": "https://pl.wiktionary.org/wiki/program", "line": "Zobacz w programie, o której zaczyna się transmisja.", "queries": ["\"Zobacz w programie, o której zaczyna się transmisja.\""], "class": "mirror_only", "hit_url": "https://pl.glosbe.com/pl/pl/program", "hit_kind": "wiktionary mirror", "note": "Wiktionary + glosbe only"}
90
+ {"n": 90, "id": "wiktionary_examples_42433", "url": "https://pl.wiktionary.org/wiki/mi%C4%99sny", "line": "Agent nie powiedział, że w okolicy znajdują się zakłady mięsne (= produkujące wyroby mięsne).", "queries": ["\"Agent nie powiedział, że w okolicy znajdują się zakłady mięsne (= produkujące wyroby mięsne).\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "No verbatim hit in two query attempts"}
91
+ {"n": 91, "id": "wiktionary_examples_459859", "url": "https://pl.wiktionary.org/wiki/rozwi%C4%85zywa%C4%87", "line": "To w zabawie dzieci rozwijają empatię, uczą się negocjować, zawierać kompromisy oraz rozwiązywać konflikty.", "queries": ["\"To w zabawie dzieci rozwijają empatię, uczą się negocjować, zawierać kompromisy oraz rozwiązywać konflikty.\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "No verbatim hit in two query attempts"}
92
+ {"n": 92, "id": "wiktionary_examples_73", "url": "https://pl.wiktionary.org/wiki/stary", "line": "Nie możesz się zalogować, bo podajesz stare hasło.", "queries": ["\"Nie możesz się zalogować, bo podajesz stare hasło.\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "No verbatim hit in two query attempts"}
93
+ {"n": 93, "id": "wiktionary_examples_597022", "url": "https://pl.wiktionary.org/wiki/ust%C4%99powa%C4%87", "line": "Jestem legalnie wybranym prezydentem i nie zamierzam ustępować z urzędu.", "queries": ["\"Jestem legalnie wybranym prezydentem i nie zamierzam ustępować z urzędu.\""], "class": "paraphrase_not_verbatim", "hit_url": null, "hit_kind": null, "note": "Janukowycz Feb 2014 news (interia, bankier) has 'Jestem legalnie wybranym prezydentem' and 'Nie zamierzam ustępować z urzędu' as separate quotes, not the same sentence; topical/partial overlap only"}
94
+ {"n": 94, "id": "wiktionary_examples_544302", "url": "https://pl.wiktionary.org/wiki/odprawia%C4%87", "line": "Królewna odprawiała jedno poselstwo po drugim.", "queries": ["\"Królewna odprawiała jedno poselstwo po drugim.\""], "class": "mirror_only", "hit_url": "https://pl.wiktionary.org/wiki/odprawia%C4%87", "hit_kind": "wiktionary", "note": "Only Wiktionary"}
95
+ {"n": 95, "id": "wiktionary_examples_944308", "url": "https://pl.wiktionary.org/wiki/dziewi%C4%99%C4%87dziesi%C4%85tkasi%C3%B3demka", "line": "Na odświeżanym w czasie rzeczywistym podglądzie zaworów wyraźnie widać, że to dziewięćdziesiątkasiódemka szwankuje.", "queries": ["\"Na odświeżanym w czasie rzeczywistym podglądzie zaworów wyraźnie widać, że to dziewięćdziesiątkasiódemka szwankuje.\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "No hit; sibling of n=79 (template-like numeral line)"}
96
+ {"n": 96, "id": "wiktionary_examples_951865", "url": "https://pl.wiktionary.org/wiki/odm%C5%82odzi%C4%87", "line": "Musimy odmłodzić ten park, wycinając chore drzewa.", "queries": ["\"Musimy odmłodzić ten park, wycinając chore drzewa.\""], "class": "mirror_only", "hit_url": "https://pl.wiktionary.org/wiki/odm%C5%82odzi%C4%87", "hit_kind": "wiktionary", "note": "Only Wiktionary"}
97
+ {"n": 97, "id": "wiktionary_examples_211149", "url": "https://pl.wiktionary.org/wiki/odpowiedzialny", "line": "Jestem odpowiedzialny za zespół do spraw analiz.", "queries": ["\"Jestem odpowiedzialny za zespół do spraw analiz.\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "No verbatim hit in two query attempts"}
98
+ {"n": 98, "id": "wiktionary_examples_122074", "url": "https://pl.wiktionary.org/wiki/pru%C4%87", "line": "Odpruł mi się guzik. Będę musiał go przyszyć.", "queries": ["\"Odpruł mi się guzik. Będę musiał go przyszyć.\""], "class": "mirror_only", "hit_url": "https://pl.glosbe.com/pl/pl/pru%C4%87", "hit_kind": "wiktionary mirror", "note": "Wiktionary + glosbe only"}
99
+ {"n": 99, "id": "wiktionary_examples_126074", "url": "https://pl.wiktionary.org/wiki/stawia%C4%87", "line": "Gdy kazałem tym gościom wynosić się do innego stolika, jeden z nich zaczął się stawiać i krzyczał, że nigdzie się stamtąd nie ruszy.", "queries": ["(distinctive 10-15 word span of line)"], "class": "mirror_only", "hit_url": "https://glosbe.com/pl/pl/stawia%C4%87", "hit_kind": "wiktionary mirror", "note": "Wiktionary + glosbe only"}
100
+ {"n": 100, "id": "wiktionary_examples_213023", "url": "https://pl.wiktionary.org/wiki/szalony", "line": "Był to monolog szalonego.", "queries": ["\"Był to monolog szalonego.\""], "class": "none", "hit_url": null, "hit_kind": null, "note": "Histmag Ed Gein page checked; sentence not present"}
data/wiktionary_examples/wiktionary_examples.stats.json CHANGED
@@ -1,16 +1,16 @@
1
  {
2
- "read": 9120,
3
- "kept": 8639,
4
  "drop_short": 0,
5
  "drop_lang": 0,
6
- "drop_dup": 481,
7
  "drop_ocr": 0,
8
- "chars": 2889761,
9
- "tokens": 1115820,
10
  "licenses": {
11
- "CC-BY-SA-3.0": 8639
12
  },
13
- "authors_with_value": 8639,
14
- "secs": 2.9,
15
- "license": "CC-BY-SA-3.0"
16
  }
 
1
  {
2
+ "read": 1829,
3
+ "kept": 1818,
4
  "drop_short": 0,
5
  "drop_lang": 0,
6
+ "drop_dup": 11,
7
  "drop_ocr": 0,
8
+ "chars": 534521,
9
+ "tokens": 207181,
10
  "licenses": {
11
+ "CC-BY-SA-4.0": 1818
12
  },
13
+ "authors_with_value": 1818,
14
+ "secs": 0.5,
15
+ "license": "CC-BY-SA-4.0"
16
  }
src/fetch_wiktionary_examples.py CHANGED
@@ -9,10 +9,13 @@ Unlike most sources in this registry, this one is NOT routed through
9
  SpeakLeash's redistribution — it is parsed directly from the Wikimedia dump.
10
  The `provenance` field in sources.py records this.
11
 
12
- One document = one headword; all its example sentences are concatenated,
13
- newline-separated, in source order. Citation attribution found in
14
- `{{źródło|...}}` templates is stripped from the text and written to a
15
- side-car file for auditing (not part of the corpus).
 
 
 
16
 
17
  Only the standard library is required for parsing; `zstandard` is used for
18
  output compression (falls back to plain .jsonl with a warning).
@@ -35,11 +38,15 @@ import json
35
  import re
36
  import sys
37
  from pathlib import Path
 
38
  from xml.etree import ElementTree as ET
39
 
40
  SOURCE_NAME = "wiktionary_examples"
41
- LICENSE = "CC-BY-SA-3.0"
42
- AUTHOR = "Wikimedia contributors"
 
 
 
43
 
44
  # Gates mirrored from build_dynaword.py so the preview count matches the build.
45
  MIN_CHARS = 200
@@ -49,15 +56,43 @@ MIN_EXAMPLE_CHARS = 10
49
  PL_HEADING = re.compile(r"^==\s*(.+?)\s*\(\{\{język polski\}\}\)\s*==\s*$", re.M)
50
  NEXT_HEADING = re.compile(r"^==[^=]", re.M)
51
 
52
- # Blocks run until the next top-level `{{template}}` marker.
 
53
  EXAMPLES_BLOCK = re.compile(
54
- r"\{\{przykłady\}\}(.*?)(?=\{\{[a-ząćęłńóśźż]+\}\}|\Z)", re.S
55
  )
56
  # Numbered lines: `: (1.1) <sentence>`
57
  NUMBERED_LINE = re.compile(r"^:\s*\(([\d.]+)\)\s*(.+?)\s*$", re.M)
58
  SENSE_NUMBER = re.compile(r"\(\d+\.\d+\)")
59
 
60
- CITATION_FIELDS = ("autor", "tytuł", "tytul", "rozdział", "rozdzial", "rok", "isbn")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
 
63
  def split_templates(text: str) -> tuple[str, list[str]]:
@@ -92,14 +127,18 @@ def split_templates(text: str) -> tuple[str, list[str]]:
92
 
93
 
94
  def describe_citation(template: str) -> str:
95
- """Flatten a `{{źródło|autor=…|tytuł=…}}` template into a readable string."""
 
 
96
  fields: dict[str, str] = {}
97
- for chunk in template.strip("{}").split("|")[1:]:
98
  if "=" in chunk:
99
  key, value = chunk.split("=", 1)
100
- fields[key.strip().lower()] = value.strip()
 
 
101
  parts = [fields[k] for k in CITATION_FIELDS if fields.get(k)]
102
- return " | ".join(parts)
103
 
104
 
105
  def unlink(text: str) -> str:
@@ -125,12 +164,14 @@ def clean(text: str) -> str:
125
  philological convention inside quotations, not markup residue."""
126
  text = re.sub(r"<ref[^>]*>.*?</ref>", "", text, flags=re.S)
127
  text = re.sub(r"<ref[^>]*/>", "", text)
 
128
  text = re.sub(r"<[^>]+>", "", text)
129
  text = unlink(text)
130
  text = re.sub(r"'{2,}", "", text)
131
  text = html.unescape(html.unescape(text)) # some entities are double-encoded
132
  text = text.replace("\u00a0", " ")
133
  text = SENSE_NUMBER.sub("", text)
 
134
  text = re.sub(r"\s+", " ", text)
135
  return text.strip(" -–—•\t")
136
 
@@ -147,26 +188,75 @@ def polish_section(wikitext: str) -> tuple[str, str] | None:
147
  return headword, rest
148
 
149
 
150
- def examples_and_citations(section: str) -> tuple[list[str], list[str]]:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  match = EXAMPLES_BLOCK.search(section)
152
  if not match:
153
- return [], []
154
- examples, citations = [], []
155
  for _, raw in NUMBERED_LINE.findall(match.group(1)):
156
  without_templates, templates = split_templates(raw)
157
- for template in templates:
158
- if template.startswith(("{{źródło", "{{zrodlo")):
159
- described = describe_citation(clean(template))
160
- if described:
161
- citations.append(described)
162
  sentence = clean(without_templates)
 
 
 
 
 
163
  if len(sentence) >= MIN_EXAMPLE_CHARS:
164
  examples.append(sentence)
165
- return examples, sorted(set(citations))
 
 
 
 
 
 
 
 
 
166
 
167
 
168
  def iter_pages(dump_path: Path):
169
- """Yield (namespace, wikitext) for every page, streaming the bz2 dump."""
170
  with bz2.open(dump_path, "rb") as handle:
171
  for _, element in ET.iterparse(handle, events=("end",)):
172
  if element.tag.rsplit("}", 1)[-1] != "page":
@@ -174,9 +264,11 @@ def iter_pages(dump_path: Path):
174
  values = {}
175
  for child in element.iter():
176
  tag = child.tag.rsplit("}", 1)[-1]
177
- if tag in ("ns", "text") and tag not in values:
 
178
  values[tag] = child.text
179
- yield (values.get("ns") or "").strip(), values.get("text") or ""
 
180
  element.clear()
181
 
182
 
@@ -197,11 +289,11 @@ def main() -> None:
197
  out_dir = Path(args.out).expanduser()
198
  out_dir.mkdir(parents=True, exist_ok=True)
199
 
200
- pages = entries = with_examples = with_citations = 0
201
- documents: list[tuple[str, str]] = []
202
  citation_index: list[dict] = []
203
 
204
- for namespace, wikitext in iter_pages(dump_path):
205
  pages += 1
206
  if pages % 100_000 == 0:
207
  print(f" {pages:,} pages scanned, {entries:,} Polish entries",
@@ -213,30 +305,34 @@ def main() -> None:
213
  continue
214
  entries += 1
215
  headword, body = section
216
- examples, citations = examples_and_citations(body)
 
 
 
 
 
217
  if not examples:
218
  continue
219
  with_examples += 1
220
- if citations:
221
- with_citations += 1
222
- citation_index.append({"headword": headword, "citations": citations})
223
- documents.append((headword, "\n".join(examples)))
224
 
225
- kept = [(h, t) for h, t in documents if len(t) >= args.min_chars]
226
- chars = sum(len(t) for _, t in kept)
227
 
228
  print()
229
  print(f"pages scanned: {pages:,}")
230
  print(f"Polish entries: {entries:,}")
231
  print(f"entries with examples: {with_examples:,}")
232
  print(f"entries with attribution: {with_citations:,}")
 
 
233
  print(f"documents >= {args.min_chars} chars: {len(kept):,}")
234
  print(f"characters: {chars:,}")
235
 
236
  payload = "\n".join(
237
- json.dumps({"text": text, "license": LICENSE, "author": AUTHOR},
238
- ensure_ascii=False)
239
- for _, text in kept
240
  ) + "\n"
241
 
242
  plain = out_dir / f"{SOURCE_NAME}.jsonl"
 
9
  SpeakLeash's redistribution — it is parsed directly from the Wikimedia dump.
10
  The `provenance` field in sources.py records this.
11
 
12
+ One document = one headword; its example sentences are concatenated,
13
+ newline-separated, in source order. A quotation from a third-party work (used
14
+ under the Art. 29 quotation right, not licensed CC BY-SA by Wiktionary
15
+ contributors) is dropped: a line carrying a `{{źródło|...}}` template or a
16
+ `<ref>`, a hand-written source such as "(B. Prus: Lalka)" or "(z Internetu)",
17
+ or an omission mark "(…)". Its citation goes to a side-car file for auditing
18
+ (not part of the corpus).
19
 
20
  Only the standard library is required for parsing; `zstandard` is used for
21
  output compression (falls back to plain .jsonl with a warning).
 
38
  import re
39
  import sys
40
  from pathlib import Path
41
+ from urllib.parse import quote
42
  from xml.etree import ElementTree as ET
43
 
44
  SOURCE_NAME = "wiktionary_examples"
45
+ # pl.wiktionary's footer links CC BY-SA 4.0 (Wikimedia Terms of Use, June 2023).
46
+ # Older revisions were contributed under 3.0, whose §4(b) allows an adaptation
47
+ # to be licensed under a later version with the same elements.
48
+ LICENSE = "CC-BY-SA-4.0"
49
+ PAGE_URL = "https://pl.wiktionary.org/wiki/"
50
 
51
  # Gates mirrored from build_dynaword.py so the preview count matches the build.
52
  MIN_CHARS = 200
 
56
  PL_HEADING = re.compile(r"^==\s*(.+?)\s*\(\{\{język polski\}\}\)\s*==\s*$", re.M)
57
  NEXT_HEADING = re.compile(r"^==[^=]", re.M)
58
 
59
+ # Blocks run until the next section marker, a `{{template}}` opening a line.
60
+ # Inline templates such as `{{tłum}}` or `{{pot}}` inside an example don't end it.
61
  EXAMPLES_BLOCK = re.compile(
62
+ r"\{\{przykłady\}\}(.*?)(?=^\{\{[a-ząćęłńóśźż]+\}\}|\Z)", re.S | re.M
63
  )
64
  # Numbered lines: `: (1.1) <sentence>`
65
  NUMBERED_LINE = re.compile(r"^:\s*\(([\d.]+)\)\s*(.+?)\s*$", re.M)
66
  SENSE_NUMBER = re.compile(r"\(\d+\.\d+\)")
67
 
68
+ # Fields of {{źródło}} and of the templates used inside <ref>: {{NKJP}}, {{cytuj}},
69
+ # {{cytuj stronę}}, {{KJP}}, {{Gloger1900}}.
70
+ CITATION_FIELDS = ("autor", "autorzy", "tytuł", "tytul", "tytuł_pub", "rozdział", "rozdzial",
71
+ "hasło", "rok", "data", "isbn", "url")
72
+ CITATION_TEMPLATES = ("{{źródło", "{{zrodlo")
73
+ # `<ref>source</ref>`, or `<ref name="x" />` reusing a source given elsewhere on the page.
74
+ REF = re.compile(r"<ref\b([^>]*?)(?:/>|>(.*?)</ref\s*>)", re.I | re.S)
75
+
76
+ # Quotations whose source is written by hand instead of with {{źródło}}, matched
77
+ # on the cleaned sentence. Patterns come from a survey of the 20261001 dump.
78
+ _UP = "A-ZĄĆĘŁŃÓŚŹŻ"
79
+ _LOW = "a-ząćęłńóśźż"
80
+ _END = r"[\s.!?…]*$"
81
+ ATTRIBUTION_TAILS = (
82
+ # A capital opening a word or an initial: "(B. Prus: Lalka)", "(Adam Mickiewicz)",
83
+ # "(Kogel-mogel)", "(Mt 4:19)", "(W leśniczówce …)". Acronyms and formulas
84
+ # ("(ZSRR)", "(C/kg)") don't match.
85
+ # ponytail: also drops a few glosses like "(Alligator missisippiensis)";
86
+ # losing a sentence is cheaper than shipping a quotation.
87
+ re.compile(rf"\(\s*[\"„“]?[{_UP}](?:[{_LOW}]|\.|\s)[^()]*\){_END}"),
88
+ # "(z Internetu)", "(z Wikipedii)", "(z Odysei)": "from <source>".
89
+ re.compile(rf"\(\s*z\s+[{_UP}{_LOW}][{_LOW}]*\){_END}", re.I),
90
+ re.compile(rf"\(\s*(?:źródło|wywiad|tytuł|słowa|cytat|za:)[^()]*\){_END}", re.I),
91
+ # Unparenthesised tag after the sentence: "…Gałczyńskiego. Internet".
92
+ re.compile(rf"(?<=[.!?…\]”\"])\s*(?:z\s+)?(?:internet\w*|wikipedi\w*){_END}", re.I),
93
+ )
94
+ # "(…)" / "[...]" mark an omission: the line was cut from someone else's text.
95
+ EXCERPT_MARK = re.compile(r"[(\[]\s*(?:…|\.\.\.)\s*[)\]]")
96
 
97
 
98
  def split_templates(text: str) -> tuple[str, list[str]]:
 
127
 
128
 
129
  def describe_citation(template: str) -> str:
130
+ """Flatten a `{{źródło|autor=…|tytuł=…}}` template into a readable string; the
131
+ template's name when it has none of CITATION_FIELDS (e.g. `{{zWikiprojektu|…}}`)."""
132
+ name, *chunks = template.strip("{}").split("|")
133
  fields: dict[str, str] = {}
134
+ for chunk in chunks:
135
  if "=" in chunk:
136
  key, value = chunk.split("=", 1)
137
+ key = key.strip().lower()
138
+ # clean() would delete a bare URL, which is the whole point of `url`.
139
+ fields[key] = value.strip() if key == "url" else clean(value)
140
  parts = [fields[k] for k in CITATION_FIELDS if fields.get(k)]
141
+ return " | ".join(parts) or "{{" + name.strip() + "}}"
142
 
143
 
144
  def unlink(text: str) -> str:
 
164
  philological convention inside quotations, not markup residue."""
165
  text = re.sub(r"<ref[^>]*>.*?</ref>", "", text, flags=re.S)
166
  text = re.sub(r"<ref[^>]*/>", "", text)
167
+ text = re.sub(r"<br\s*/?>", " ", text, flags=re.I) # a line break separates words
168
  text = re.sub(r"<[^>]+>", "", text)
169
  text = unlink(text)
170
  text = re.sub(r"'{2,}", "", text)
171
  text = html.unescape(html.unescape(text)) # some entities are double-encoded
172
  text = text.replace("\u00a0", " ")
173
  text = SENSE_NUMBER.sub("", text)
174
+ text = re.sub(r"\(\s*\)", "", text) # left behind by a stripped template
175
  text = re.sub(r"\s+", " ", text)
176
  return text.strip(" -–—•\t")
177
 
 
188
  return headword, rest
189
 
190
 
191
+ def is_cited(raw: str, templates: list[str]) -> bool:
192
+ """A line with a source attached is a quotation from a third-party work (Art. 29
193
+ quotation right), not a contributor's own CC BY-SA text."""
194
+ return "<ref" in raw.lower() or any(t.startswith(CITATION_TEMPLATES) for t in templates)
195
+
196
+
197
+ def cited_sources(raw: str, templates: list[str]) -> list[str]:
198
+ """The sources a cited line gives, for the audit side-car."""
199
+ sources = [describe_citation(t) for t in templates if t.startswith(CITATION_TEMPLATES)]
200
+ for ref in REF.finditer(raw):
201
+ attributes, body = ref.groups()
202
+ if body is None:
203
+ sources.append(f"<ref{attributes.rstrip()}/>")
204
+ continue
205
+ text, inner = split_templates(body)
206
+ # {{źródło}} inside a <ref> is already in `templates`.
207
+ sources += [describe_citation(t) for t in inner if not t.startswith(CITATION_TEMPLATES)]
208
+ sources.append(clean(text))
209
+ return [source for source in sources if source]
210
+
211
+
212
+ def hand_attribution(sentence: str) -> str | None:
213
+ """The source a quotation names without {{źródło}}, or "(…)" for an excerpt
214
+ that names none; None for a contributor's own example."""
215
+ for pattern in ATTRIBUTION_TAILS:
216
+ match = pattern.search(sentence)
217
+ if match:
218
+ return match.group(0).strip(" .!?…")
219
+ match = EXCERPT_MARK.search(sentence)
220
+ return match.group(0) if match else None
221
+
222
+
223
+ def examples_and_citations(section: str) -> tuple[list[str], list[str], int]:
224
+ """(example sentences, citations of the dropped quotations, number of dropped lines).
225
+
226
+ A line is a quotation when it carries {{źródło}}/<ref> or a hand-written
227
+ source (see hand_attribution)."""
228
  match = EXAMPLES_BLOCK.search(section)
229
  if not match:
230
+ return [], [], 0
231
+ examples, citations, dropped = [], [], 0
232
  for _, raw in NUMBERED_LINE.findall(match.group(1)):
233
  without_templates, templates = split_templates(raw)
234
+ if is_cited(raw, templates):
235
+ dropped += 1
236
+ citations.extend(cited_sources(raw, templates) or ["(no source text)"])
237
+ continue
 
238
  sentence = clean(without_templates)
239
+ attribution = hand_attribution(sentence)
240
+ if attribution:
241
+ dropped += 1
242
+ citations.append(attribution)
243
+ continue
244
  if len(sentence) >= MIN_EXAMPLE_CHARS:
245
  examples.append(sentence)
246
+ return examples, sorted(set(citations)), dropped
247
+
248
+
249
+ def page_url(title: str) -> str:
250
+ return PAGE_URL + quote(title.replace(" ", "_"), safe="/:()',!")
251
+
252
+
253
+ def credit(title: str) -> str:
254
+ """BY-SA 4.0 §3(a)(2) allows attribution by a URI; the page history lists the authors."""
255
+ return f"Wikisłownik contributors, {page_url(title)}"
256
 
257
 
258
  def iter_pages(dump_path: Path):
259
+ """Yield (namespace, page id, title, wikitext) for every page, streaming the bz2 dump."""
260
  with bz2.open(dump_path, "rb") as handle:
261
  for _, element in ET.iterparse(handle, events=("end",)):
262
  if element.tag.rsplit("}", 1)[-1] != "page":
 
264
  values = {}
265
  for child in element.iter():
266
  tag = child.tag.rsplit("}", 1)[-1]
267
+ # The page's own <id> precedes its revision's <id>.
268
+ if tag in ("ns", "id", "title", "text") and tag not in values:
269
  values[tag] = child.text
270
+ yield ((values.get("ns") or "").strip(), (values.get("id") or "").strip(),
271
+ values.get("title") or "", values.get("text") or "")
272
  element.clear()
273
 
274
 
 
289
  out_dir = Path(args.out).expanduser()
290
  out_dir.mkdir(parents=True, exist_ok=True)
291
 
292
+ pages = entries = with_examples = with_citations = quoted_lines = example_lines = 0
293
+ documents: list[dict] = []
294
  citation_index: list[dict] = []
295
 
296
+ for namespace, page_id, title, wikitext in iter_pages(dump_path):
297
  pages += 1
298
  if pages % 100_000 == 0:
299
  print(f" {pages:,} pages scanned, {entries:,} Polish entries",
 
305
  continue
306
  entries += 1
307
  headword, body = section
308
+ examples, citations, dropped = examples_and_citations(body)
309
+ quoted_lines += dropped
310
+ if citations:
311
+ with_citations += 1
312
+ citation_index.append({"id": f"{SOURCE_NAME}_{page_id}", "headword": headword,
313
+ "citations": citations})
314
  if not examples:
315
  continue
316
  with_examples += 1
317
+ example_lines += len(examples)
318
+ documents.append({"id": f"{SOURCE_NAME}_{page_id}", "text": "\n".join(examples),
319
+ "license": LICENSE, "author": credit(title)})
 
320
 
321
+ kept = [d for d in documents if len(d["text"]) >= args.min_chars]
322
+ chars = sum(len(d["text"]) for d in kept)
323
 
324
  print()
325
  print(f"pages scanned: {pages:,}")
326
  print(f"Polish entries: {entries:,}")
327
  print(f"entries with examples: {with_examples:,}")
328
  print(f"entries with attribution: {with_citations:,}")
329
+ print(f"quoted lines dropped: {quoted_lines:,}")
330
+ print(f"example lines kept: {example_lines:,}")
331
  print(f"documents >= {args.min_chars} chars: {len(kept):,}")
332
  print(f"characters: {chars:,}")
333
 
334
  payload = "\n".join(
335
+ json.dumps(document, ensure_ascii=False) for document in kept
 
 
336
  ) + "\n"
337
 
338
  plain = out_dir / f"{SOURCE_NAME}.jsonl"
src/sources.py CHANGED
@@ -158,20 +158,29 @@ SOURCES = {
158
  "added": "2026-07-19",
159
  "release": "0.2.5",
160
  "file_key": "wiktionary_examples",
 
161
  "pretty": "Polish Wiktionary usage examples",
162
  "provenance": "Parsed directly from the official Wikimedia dump "
163
- "(plwiktionary-latest-pages-articles.xml.bz2); not routed "
164
- "through SpeakLeash. Usage-example sections of Polish-language "
165
- "entries extracted and grouped one document per headword.",
166
- "license": "CC-BY-SA-3.0",
167
- "license_spdx": "CC-BY-SA-3.0",
168
- "traceable": "Wikimedia dumps explicitly released under CC-BY-SA 3.0; "
169
- "attribution to contributors + share-alike preserved. "
170
- "Derived subset: usage-example sections from Polish-language "
171
- "entries only, grouped one document per headword.",
172
- "upstream": "https://dumps.wikimedia.org/plwiktionary/latest/",
 
 
 
 
 
 
 
 
173
  "domain": "lexicographic",
174
- "created": "2004-03-22, 2026-08-15",
175
  "is_ocr": False,
176
  },
177
  "eurlex": {
 
158
  "added": "2026-07-19",
159
  "release": "0.2.5",
160
  "file_key": "wiktionary_examples",
161
+ "preserve_id": True,
162
  "pretty": "Polish Wiktionary usage examples",
163
  "provenance": "Parsed directly from the official Wikimedia dump "
164
+ "plwiktionary-20261001-pages-articles.xml.bz2 by "
165
+ "src/fetch_wiktionary_examples.py; not routed through SpeakLeash. "
166
+ "Usage-example sections of Polish-language entries, one document "
167
+ "per headword, id from the page id.",
168
+ "legal_note": "Quotations from third-party works are dropped: lines citing a source "
169
+ "with {{źródło}} or <ref>, lines naming one by hand (\"(B. Prus: "
170
+ "Lalka)\", \"(z Internetu)\") and excerpts marked \"(…)\". They are "
171
+ "used on Wiktionary under the quotation right (Art. 29) and are not "
172
+ "the contributors' CC BY-SA text. Unattributed quotations a contributor "
173
+ "pasted without any marker cannot be detected.",
174
+ "license": "CC-BY-SA-4.0",
175
+ "license_spdx": "CC-BY-SA-4.0",
176
+ "traceable": "Contributors license their text under CC BY-SA 4.0 (Wikimedia Terms "
177
+ "of Use, June 2023; pl.wiktionary footer). Revisions before that were "
178
+ "contributed under CC BY-SA 3.0, which allows an adaptation under a "
179
+ "later version (3.0 §4(b)). Each row's author field links its page, "
180
+ "whose history names the contributors (4.0 §3(a)(2)).",
181
+ "upstream": "https://dumps.wikimedia.org/plwiktionary/20261001/",
182
  "domain": "lexicographic",
183
+ "created": "2004-03-22, 2026-10-01",
184
  "is_ocr": False,
185
  },
186
  "eurlex": {
src/test_wiktionary_examples.py ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Cited usage examples are third-party quotations and must not reach the corpus."""
2
+
3
+ from fetch_wiktionary_examples import examples_and_citations
4
+
5
+ SECTION = """{{znaczenia}}
6
+ ''rzeczownik''
7
+ : (1.1) [[dom]]
8
+ {{przykłady}}
9
+ : (1.1) Kupiliśmy '''dom''' pod miastem.
10
+ : (1.1) ''Dom stał na wzgórzu.'' {{źródło|autor=Bolesław Prus|tytuł=Lalka|rok=1890}}
11
+ : (1.2) Wróciłem do domu późno.<ref>Narodowy Korpus Języka Polskiego</ref>
12
+ : (1.2) Nasz '''dom''' ma ogród. {{zrodlo|autor=Jan Nowak|tytuł={{kursywa|Ogrody}}}}
13
+ : (1.3) To [[mieszkanie|mieszkanie]] jest jasne i ciche.
14
+ {{składnia}}
15
+ """
16
+
17
+
18
+ def test_cited_lines_are_dropped_and_recorded():
19
+ examples, citations, dropped = examples_and_citations(SECTION)
20
+ assert examples == ["Kupiliśmy dom pod miastem.", "To mieszkanie jest jasne i ciche."]
21
+ assert dropped == 3
22
+ assert "Bolesław Prus | Lalka | 1890" in citations
23
+ assert any(c.startswith("Jan Nowak") for c in citations)
24
+ assert "Narodowy Korpus Języka Polskiego" in citations
25
+
26
+
27
+ def test_every_ref_shape_leaves_a_record():
28
+ section = """{{przykłady}}
29
+ : (1.1) Pies szczeka.<ref name="nkjp" />
30
+ : (1.2) Kot śpi.<ref name=prus>{{źródło|autor=Bolesław Prus|tytuł=Lalka}}</ref>
31
+ : (1.3) Ptak śpiewa.<REF>[[NKJP]], 2001</REF>
32
+ : (1.4) Ryba pływa.<ref></ref>
33
+ : (1.5) Koń biegnie.<ref>{{NKJP|autorzy=Andrzej Sapkowski|tytuł_pub=Chrzest ognia|data=1996|hash=3eeeb574}}</ref>
34
+ : (1.6) Mysz piszczy.<ref>{{cytuj stronę | autor = Jan Kowal | url = https://example.pl/a }}</ref>
35
+ : (1.7) Wół ryczy.<ref>{{zWikiprojektu|Wikipedia|Wół}}</ref>
36
+ """
37
+ examples, citations, dropped = examples_and_citations(section)
38
+ assert (examples, dropped) == ([], 7)
39
+ assert citations == sorted({'<ref name="nkjp"/>', "Bolesław Prus | Lalka", "NKJP, 2001",
40
+ "(no source text)", "Andrzej Sapkowski | Chrzest ognia | 1996",
41
+ "Jan Kowal | https://example.pl/a", "{{zWikiprojektu}}"})
42
+
43
+
44
+ def test_section_without_examples():
45
+ assert examples_and_citations("{{znaczenia}}\n: (1.1) dom\n") == ([], [], 0)
46
+
47
+
48
+ import pytest
49
+
50
+ from fetch_wiktionary_examples import clean, hand_attribution
51
+
52
+ # Shapes taken from the plwiktionary 20261001 dump (sentences shortened).
53
+ QUOTED = [
54
+ ("Podłoże trasy stanowiła błotnista glajda. (z Internetu)", "(z Internetu)"),
55
+ ("Graficy trochę bardziej poszaleli. (Z internetu)", "(Z internetu)"),
56
+ ("Za pokojem orędował Piotr Włostowic (Wikipedia)", "(Wikipedia)"),
57
+ ("Obraz przedstawia cztery dziewczęta. (z Wikipedii)", "(z Wikipedii)"),
58
+ ("Zbiornik wody rosły mury budynków. (B. Prus: Emancypantki)", "(B. Prus: Emancypantki)"),
59
+ ("Żyła lat pięć z mężem. (J. I. Kraszewski: Ulana)", "(J. I. Kraszewski: Ulana)"),
60
+ ("Czesz się, Jerzy, jak należy! (J. Brzechwa: Grzebień i szczotka)", "(J. Brzechwa: Grzebień i szczotka)"),
61
+ ("Wrona gdzieniegdzie kracze. (Adam Mickiewicz)", "(Adam Mickiewicz)"),
62
+ ("Rozmiary piwnic miały być wielkie. (K. Grzybowski)", "(K. Grzybowski)"),
63
+ ("Ma pani wszystkich w domu? (Kogel-mogel)", "(Kogel-mogel)"),
64
+ ("To leśniczówka Pranie. (W leśniczówce Konstanty Ildefons Gałczyński)",
65
+ "(W leśniczówce Konstanty Ildefons Gałczyński)"),
66
+ ("Idź pan w chuj z takim żartem! (Kaliber 44: \"Litery\")", "(Kaliber 44: \"Litery\")"),
67
+ ("Pójdźcie za Mną, a uczynię was rybakami ludzi (Mt 4:19)", "(Mt 4:19)"),
68
+ ("Zła się nie ulęknę, bo Ty jesteś ze mną. (Ps 23, 4)", "(Ps 23, 4)"),
69
+ ("Do pogrążenia narodu w ciemnocie (Tadeusz Boy-Żeleński: \"Dziewice\").", "(Tadeusz Boy-Żeleński: \"Dziewice\")"),
70
+ ("Zobaczyli wywiad dla „Gazety Polskiej”. (Onet.pl)", "(Onet.pl)"),
71
+ ("Wiersz o Odyseuszu. (z Odysei)", "(z Odysei)"),
72
+ ("Ale nas zbaw ode złego (słowa modlitwy Ojcze Nasz)", "(słowa modlitwy Ojcze Nasz)"),
73
+ ("Kiedy przyszła, powiedziała to. (źródło)", "(źródło)"),
74
+ ("Uliczka Krakowa z wiersza Gałczyńskiego. Internet", "Internet"),
75
+ ("Na płycie znalazły się utwory Lindy […] Wikipedia", "Wikipedia"),
76
+ ("(…) potem pójdziemy 5 kilometrów na południe (…)", "(…)"),
77
+ ("Na taką dolegliwość lekarze rozkładają ręce […] i tyle.", "[…]"),
78
+ ("Rząd przyznał priorytet technologii. [...] i dalej", "[...]"),
79
+ ]
80
+
81
+ # Contributor glosses and in-sentence words that must survive.
82
+ KEPT = [
83
+ "Kombinat ma dwie linie ciągłego odlewania stali (COS).",
84
+ "Rozpad ZSRR nastąpił w 1991 roku (ZSRR).",
85
+ "Jednostką jest kulomb na kilogram (C/kg).",
86
+ "Prawdopodobieństwo wynosi dziesięć procent (0,1).",
87
+ "Spokojniej proszę (od spokojnie).",
88
+ "Muszę jeszcze ugotować obiad (= Muszę jeszcze ugotować obiad.)",
89
+ "Każdy owoc pasuje (z wyjątkiem mleka kokosowego).",
90
+ "Stosuje się do tego regułę (z alternacją ch:sz).",
91
+ "Wszystkie te informacje pochodzą z Internetu.",
92
+ "Polska Wikipedia powstała 26 września 2001 roku.",
93
+ "Memy internetowe wykorzystuje się w reklamie.",
94
+ "Jaja jako bogate źródło substancji odżywczych są podstawą wielu potraw.",
95
+ "Mikołaj Kopernik był wybitnym astronomem (twierdzenie Ptolemeusza)",
96
+ "Ile to kosztuje? Cztery złocisze.",
97
+ "Bank miał siedzibę przy alei 1 Maja (ob. al. Piłsudskiego).",
98
+ "Hans Klawincker (fl. 1586-1635 w Norymberdze)",
99
+ "Mój przyjaciel mieszka w Bielsku-Białej (nie: Bielsko-Białej).",
100
+ ]
101
+
102
+
103
+ @pytest.mark.parametrize("sentence,source", QUOTED)
104
+ def test_hand_written_source_marks_a_quotation(sentence, source):
105
+ assert hand_attribution(sentence) == source
106
+
107
+
108
+ @pytest.mark.parametrize("sentence", KEPT)
109
+ def test_glosses_are_not_attributions(sentence):
110
+ assert hand_attribution(sentence) is None
111
+
112
+
113
+ def test_hand_attributed_lines_are_dropped_and_recorded():
114
+ section = """{{przykłady}}
115
+ : (1.1) Kupiliśmy '''dom''' pod miastem.
116
+ : (1.1) Dom stał na wzgórzu. ([[Bolesław Prus|B. Prus]]: ''Lalka'')
117
+ : (1.2) Nasz dom ma ogród (…)
118
+ {{składnia}}
119
+ """
120
+ examples, citations, dropped = examples_and_citations(section)
121
+ assert examples == ["Kupiliśmy dom pod miastem."]
122
+ assert dropped == 2
123
+ assert citations == ["(B. Prus: Lalka)", "(…)"]
124
+
125
+
126
+ def test_inline_template_does_not_end_the_examples_block():
127
+ section = """{{przykłady}}
128
+ : (1.1) ''Dziesięć małych Murzyniątek.'' (A. Christie: ''Dziesięciu Murzynków'', {{tłum}} Włodzimierz Lewik)
129
+ : (1.2) Kupiliśmy '''dom''' pod miastem.
130
+ {{składnia}}
131
+ : (1.1) To nie jest przykład, tylko składnia.
132
+ """
133
+ examples, citations, dropped = examples_and_citations(section)
134
+ assert examples == ["Kupiliśmy dom pod miastem."]
135
+ assert dropped == 1
136
+ assert citations == ["(A. Christie: Dziesięciu Murzynków, Włodzimierz Lewik)"]
137
+
138
+
139
+ def test_clean_separates_br_and_drops_empty_parens():
140
+ assert clean("na wzgórzu<br />to leśniczówka") == "na wzgórzu to leśniczówka"
141
+ assert clean("() Holdek ciepnył bala z autu.") == "Holdek ciepnył bala z autu."
142
+
143
+
144
+ def test_page_id_title_and_credit(tmp_path):
145
+ import bz2
146
+
147
+ from fetch_wiktionary_examples import credit, iter_pages
148
+
149
+ dump = tmp_path / "dump.xml.bz2"
150
+ dump.write_bytes(bz2.compress("""<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/">
151
+ <page><title>wielki piec</title><ns>0</ns><id>42</id>
152
+ <revision><id>9001</id><text>== wielki piec ({{język polski}}) ==</text></revision></page>
153
+ </mediawiki>""".encode("utf-8")))
154
+ assert list(iter_pages(dump)) == [("0", "42", "wielki piec", "== wielki piec ({{język polski}}) ==")]
155
+ assert credit("wielki piec") == "Wikisłownik contributors, https://pl.wiktionary.org/wiki/wielki_piec"
156
+ assert credit("żółw") == "Wikisłownik contributors, https://pl.wiktionary.org/wiki/%C5%BC%C3%B3%C5%82w"
src/test_wiktionary_examples_contract.py ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Contract checks for the released wiktionary_examples data (src/fetch_wiktionary_examples.py)."""
2
+
3
+ import json
4
+ import re
5
+ from pathlib import Path
6
+
7
+ import pyarrow.parquet as pq
8
+
9
+ from fetch_wiktionary_examples import LICENSE, PAGE_URL, hand_attribution
10
+ from sources import SOURCES
11
+
12
+ ROOT = Path(__file__).resolve().parents[1]
13
+ DATA = ROOT / "data" / "wiktionary_examples"
14
+
15
+
16
+ def test_schema_counts_license_and_attribution():
17
+ stats = json.loads((DATA / "wiktionary_examples.stats.json").read_text(encoding="utf-8"))
18
+ evidence = json.loads((DATA / "wiktionary_examples.license-evidence.json").read_text(encoding="utf-8"))
19
+ table = pq.read_table(DATA / "wiktionary_examples.parquet")
20
+ rows = table.select(["id", "source", "license", "author"]).to_pylist()
21
+ entry = SOURCES["wiktionary_examples"]
22
+ assert table.column_names == ["id", "text", "source", "added", "created", "token_count", "license", "author"]
23
+ assert table.num_rows == stats["kept"] == evidence["release_scope"]["documents_released"]
24
+ assert stats["read"] == evidence["release_scope"]["documents_200_chars_or_more"]
25
+ assert stats["drop_dup"] == evidence["release_scope"]["dropped_duplicates"]
26
+ assert len({r["id"] for r in rows}) == table.num_rows
27
+ assert all(re.fullmatch(r"wiktionary_examples_\d+", r["id"]) for r in rows)
28
+ assert {r["source"] for r in rows} == {"wiktionary_examples"}
29
+ assert {r["license"] for r in rows} == {LICENSE} == {entry["license"]} == {entry["license_spdx"]} == {evidence["license"]}
30
+ assert stats["licenses"] == {LICENSE: table.num_rows}
31
+ assert entry["preserve_id"] is True
32
+ assert all(r["author"].startswith(f"Wikisłownik contributors, {PAGE_URL}") for r in rows)
33
+
34
+
35
+ def test_no_quotation_reached_the_release():
36
+ for text in pq.read_table(DATA / "wiktionary_examples.parquet", columns=["text"]).column("text").to_pylist():
37
+ assert len(text) >= 200
38
+ assert "<ref" not in text.lower() and "{{" not in text
39
+ for line in text.split("\n"):
40
+ assert hand_attribution(line) is None, line
41
+
42
+
43
+ def test_quotation_sample_matches_the_release():
44
+ """The web sample must be redrawn if the released lines change."""
45
+ import random
46
+ from collections import Counter
47
+
48
+ sample = json.loads((DATA / "wiktionary_examples.license-evidence.json").read_text(encoding="utf-8"))["quotation_sample"]
49
+ rows = [json.loads(line) for line in (DATA / sample["file"]).read_text(encoding="utf-8").splitlines()]
50
+ table = pq.read_table(DATA / "wiktionary_examples.parquet", columns=["id", "text"]).to_pylist()
51
+ lines = [(r["id"], line) for r in table for line in r["text"].split("\n") if line.strip()]
52
+ random.seed(sample["seed"])
53
+ assert len(lines) == sample["lines_in_release"]
54
+ assert [(r["id"], r["line"]) for r in rows] == random.sample(lines, sample["lines_sampled"])
55
+ assert [r["n"] for r in rows] == list(range(1, sample["lines_sampled"] + 1))
56
+ assert all(len(r["queries"]) >= 1 for r in rows)
57
+ assert dict(Counter(r["class"] for r in rows)) == sample["classes"]
58
+ assert "external" not in sample["classes"] and sample["quotations_found"] == 0