wikitrans-1.3/0000755000175000017500000000000013342564531013324 5ustar graygray00000000000000wikitrans-1.3/testdata/0000755000175000017500000000000013342564531015135 5ustar graygray00000000000000wikitrans-1.3/testdata/para.text0000644000175000017500000000025713340032704016760 0ustar graygray00000000000000First paragraph consists of two sentences. Each sentence occupies a line. Second paragraph consists of two sentences as well. Each of them, again, occupies its own line. wikitrans-1.3/testdata/hz.html0000644000175000017500000000025513340032704016434 0ustar graygray00000000000000

You can make horizontal dividing lines (----) to separate text.


But you should usually use sections instead, so that they go in the table of contents.

wikitrans-1.3/testdata/colon.texi0000644000175000017500000000046013340032704017130 0ustar graygray00000000000000 @w{ }A colon (:) indents a line or paragraph. A newline starts a new paragraph. Should only be used on talk pages. For articles, you probably want the blockquote tag. @w{ }We use 1 colon to indent once. @w{ }@w{ }We use 2 colons to indent twice. @w{ }@w{ }@w{ }3 colons to indent 3 times, and so on. wikitrans-1.3/testdata/boldit1.text0000644000175000017500000000001413340032704017362 0ustar graygray00000000000000A B _C_ D wikitrans-1.3/testdata/itbold3.texi0000644000175000017500000000002013340032704017346 0ustar graygray00000000000000@i{a b @b{c d}} wikitrans-1.3/testdata/para.texi0000644000175000017500000000025413340032704016742 0ustar graygray00000000000000First paragraph consists of two sentences. Each sentence occupies a line. Second paragraph consists of two sentences as well. Each of them, again, occupies its own line. wikitrans-1.3/testdata/itbold3.wiki0000644000175000017500000000002113340032704017341 0ustar graygray00000000000000''a b '''c d'''''wikitrans-1.3/testdata/itbold1.wiki0000644000175000017500000000002113340032704017337 0ustar graygray00000000000000''a b '''c''' d''wikitrans-1.3/testdata/header0.texi0000644000175000017500000000005213340032704017323 0ustar graygray00000000000000 @section Header @node Header Paragraph. wikitrans-1.3/testdata/boldit3.html0000644000175000017500000000003513340032704017347 0ustar graygray00000000000000

a b c d

wikitrans-1.3/testdata/boldit3.texi0000644000175000017500000000002013340032704017346 0ustar graygray00000000000000@b{a b @i{c d}} wikitrans-1.3/testdata/itbold2.html0000644000175000017500000000003513340032704017346 0ustar graygray00000000000000

a b c d

wikitrans-1.3/testdata/para.wiki0000644000175000017500000000025413340032704016734 0ustar graygray00000000000000First paragraph consists of two sentences. Each sentence occupies a line. Second paragraph consists of two sentences as well. Each of them, again, occupies its own line. wikitrans-1.3/testdata/itbold3.text0000644000175000017500000000001413340032704017364 0ustar graygray00000000000000_a b C D_ wikitrans-1.3/testdata/nowiki-tag.wiki0000644000175000017500000000002113340032704020052 0ustar graygray00000000000000A <tag> wikitrans-1.3/testdata/boldit1.texi0000644000175000017500000000002013340032704017344 0ustar graygray00000000000000@b{a b @i{c} d} wikitrans-1.3/testdata/hz.wiki0000644000175000017500000000023513340032704016431 0ustar graygray00000000000000You can make horizontal dividing lines (----) to separate text. ---- But you should usually use sections instead, so that they go in the table of contents. wikitrans-1.3/testdata/hz.texi0000644000175000017500000000024013340032704016433 0ustar graygray00000000000000You can make horizontal dividing lines (----) to separate text. ----- But you should usually use sections instead, so that they go in the table of contents. wikitrans-1.3/testdata/link.texi0000644000175000017500000000004113340032704016746 0ustar graygray00000000000000@ref{link,foo} is a simple link. wikitrans-1.3/testdata/unlist.html0000644000175000017500000000045713340032704017335 0ustar graygray00000000000000

marks the end of the list.

wikitrans-1.3/testdata/numlist.text0000644000175000017500000000022013340032704017516 0ustar graygray00000000000000 1. _Numbered lists_ are: 1. Very organized 2. Easy to follow A newline marks the end of the list. 1. New numbering starts with 1. wikitrans-1.3/testdata/boldit2.html0000644000175000017500000000003513340032704017346 0ustar graygray00000000000000

a b c d

wikitrans-1.3/testdata/colon.html0000644000175000017500000000061413340032704017124 0ustar graygray00000000000000
A colon (:) indents a line or paragraph.

A newline starts a new paragraph. Should only be used on talk pages. For articles, you probably want the blockquote tag.

We use 1 colon to indent once.
We use 2 colons to indent twice.
3 colons to indent 3 times, and so on.
wikitrans-1.3/testdata/boldit3.text0000644000175000017500000000001413340032704017364 0ustar graygray00000000000000A B _C D_ wikitrans-1.3/testdata/deflist.text0000644000175000017500000000010713340032704017461 0ustar graygray00000000000000 item 1 definition 1 item 2 definition 2-1 definition 2-2 wikitrans-1.3/testdata/header0.wiki0000644000175000017500000000003113340032704017312 0ustar graygray00000000000000== Header == Paragraph. wikitrans-1.3/testdata/itbold2.text0000644000175000017500000000001413340032704017363 0ustar graygray00000000000000_A B c d_ wikitrans-1.3/testdata/headings.texi0000644000175000017500000000076113340032704017604 0ustar graygray00000000000000 @section Section headings @node Section headings @i{Headings} organize your writing into sections. The Wiki software can automatically generate a @ref{table of contents} from them. @subsection Subsection @node Subsection Using more "equals" (=) signs creates a subsection. @subsubsection A smaller subsection @node A smaller subsection Don't skip levels, like from two to four equals signs. Start with 2 equals signs not 1 because 1 creates H1 tags which should be reserved for page title. wikitrans-1.3/testdata/it.html0000644000175000017500000000007213340032704016424 0ustar graygray00000000000000

now is the time for all good men to come to

wikitrans-1.3/testdata/nowiki-ind.text0000644000175000017500000000002413340032704020075 0ustar graygray00000000000000Para a b c para wikitrans-1.3/testdata/deflist.html0000644000175000017500000000015313340032704017442 0ustar graygray00000000000000
item 1
definition 1
item 2
definition 2-1
definition 2-2
wikitrans-1.3/testdata/nowiki-tag.text0000644000175000017500000000001213340032704020073 0ustar graygray00000000000000A wikitrans-1.3/testdata/itbold2.texi0000644000175000017500000000002013340032704017345 0ustar graygray00000000000000@i{@b{a b} c d} wikitrans-1.3/testdata/boldit1.wiki0000644000175000017500000000002313340032704017341 0ustar graygray00000000000000'''a b ''c'' d''' wikitrans-1.3/testdata/nowiki.html0000644000175000017500000000005113340032704017305 0ustar graygray00000000000000

#:version=1.0rest of line

wikitrans-1.3/testdata/bold.text0000644000175000017500000000005613340032704016752 0ustar graygray00000000000000now is the time for ALL GOOD men to come to wikitrans-1.3/testdata/boldit2.text0000644000175000017500000000001413340032704017363 0ustar graygray00000000000000_A B_ C D wikitrans-1.3/testdata/hz.text0000644000175000017500000000035113340032704016451 0ustar graygray00000000000000You can make horizontal dividing lines (----) to separate text. ------------------------------------------------------------------------- But you should usually use sections instead, so that they go in the table of contents. wikitrans-1.3/testdata/numlist.html0000644000175000017500000000030013340032704017475 0ustar graygray00000000000000
  1. Numbered lists are:
    1. Very organized
    2. Easy to follow

A newline marks the end of the list.

  1. New numbering starts with 1.
wikitrans-1.3/testdata/link.wiki0000644000175000017500000000005413340032704016744 0ustar graygray00000000000000[[link|foo|bar|baz|text]] is a simple link. wikitrans-1.3/testdata/itbold1.texi0000644000175000017500000000002013340032704017344 0ustar graygray00000000000000@i{a b @b{c} d} wikitrans-1.3/testdata/boldit2.texi0000644000175000017500000000002013340032704017345 0ustar graygray00000000000000@b{@i{a b} c d} wikitrans-1.3/testdata/headings.html0000644000175000017500000000077413340032704017603 0ustar graygray00000000000000

Section headings

Headings organize your writing into sections. The Wiki software can automatically generate a table of contents from them.

Subsection

Using more "equals" (=) signs creates a subsection.

A smaller subsection

Don't skip levels, like from two to four equals signs.

Start with 2 equals signs not 1 because 1 creates H1 tags which should be reserved for page title.

wikitrans-1.3/testdata/boldit0.texi0000644000175000017500000000006413340032704017353 0ustar graygray00000000000000now is the time for @i{@b{all good}} men to come to wikitrans-1.3/testdata/unlist.text0000644000175000017500000000036213340032704017350 0ustar graygray00000000000000 - _Unordered lists_ are easy to do: - Start every line with a star. - More stars indicate a deeper level. Previous item continues. - A newline - in a list marks the end of the list. - Of course you can start again. wikitrans-1.3/testdata/itbold1.text0000644000175000017500000000001413340032704017362 0ustar graygray00000000000000_a b C d_ wikitrans-1.3/testdata/boldit0.html0000644000175000017500000000010113340032704017336 0ustar graygray00000000000000

now is the time for all good men to come to

wikitrans-1.3/testdata/boldit1.html0000644000175000017500000000003513340032704017345 0ustar graygray00000000000000

a b c d

wikitrans-1.3/testdata/nowiki.wiki0000644000175000017500000000005713340032704017312 0ustar graygray00000000000000#:version=1.0''rest'' of line wikitrans-1.3/testdata/para.html0000644000175000017500000000027213340032704016735 0ustar graygray00000000000000

First paragraph consists of two sentences. Each sentence occupies a line.

Second paragraph consists of two sentences as well. Each of them, again, occupies its own line.

wikitrans-1.3/testdata/it.texi0000644000175000017500000000006013340032704016426 0ustar graygray00000000000000now is the time for @i{all good} men to come to wikitrans-1.3/testdata/headings.wiki0000644000175000017500000000063613340032704017577 0ustar graygray00000000000000== Section headings == ''Headings'' organize your writing into sections. The Wiki software can automatically generate a [[table of contents]] from them. === Subsection === Using more "equals" (=) signs creates a subsection. ==== A smaller subsection ==== Don't skip levels, like from two to four equals signs. Start with 2 equals signs not 1 because 1 creates H1 tags which should be reserved for page title. wikitrans-1.3/testdata/reclink.wiki0000644000175000017500000000011313340032704017432 0ustar graygray00000000000000[[link|foo|bar|baz|text [[inny link|znów text]] słowo [[jeszcze link]]]] wikitrans-1.3/testdata/nowiki-ind.wiki0000644000175000017500000000005013340032704020053 0ustar graygray00000000000000Para a b c para wikitrans-1.3/testdata/itbold2.wiki0000644000175000017500000000002113340032704017340 0ustar graygray00000000000000'''''a b''' c d''wikitrans-1.3/testdata/bold.wiki0000644000175000017500000000006213340032704016726 0ustar graygray00000000000000now is the time for '''all good''' men to come to wikitrans-1.3/testdata/nowiki-ind.html0000644000175000017500000000005313340032704020057 0ustar graygray00000000000000

Para

a b c

para

wikitrans-1.3/testdata/nowiki.text0000644000175000017500000000003613340032704017330 0ustar graygray00000000000000#:version=1.0_rest_ of line wikitrans-1.3/testdata/boldit3.wiki0000644000175000017500000000002213340032704017342 0ustar graygray00000000000000'''a b ''c d''''' wikitrans-1.3/testdata/nowiki.texi0000644000175000017500000000003613340032704017315 0ustar graygray00000000000000#:version=1.0@i{rest} of line wikitrans-1.3/testdata/boldit0.wiki0000644000175000017500000000006613340032704017347 0ustar graygray00000000000000now is the time for '''''all good''''' men to come to wikitrans-1.3/testdata/deflist.wiki0000644000175000017500000000010113340032704017432 0ustar graygray00000000000000;item 1 : definition 1 ;item 2 : definition 2-1 : definition 2-2 wikitrans-1.3/testdata/nowiki-tag.html0000644000175000017500000000002613340032704020060 0ustar graygray00000000000000

A <tag>

wikitrans-1.3/testdata/it.wiki0000644000175000017500000000006013340032704016420 0ustar graygray00000000000000now is the time for ''all good'' men to come to wikitrans-1.3/testdata/numlist.wiki0000644000175000017500000000020313340032704017476 0ustar graygray00000000000000# ''Numbered lists'' are: ## Very organized ## Easy to follow A newline marks the end of the list. # New numbering starts with 1. wikitrans-1.3/testdata/unlist.wiki0000644000175000017500000000034213340032704017325 0ustar graygray00000000000000* ''Unordered lists'' are easy to do: ** Start every line with a star. *** More stars indicate a deeper level. *: Previous item continues. ** A newline * in a list marks the end of the list. *Of course you can start again. wikitrans-1.3/testdata/bold.html0000644000175000017500000000007213340032704016730 0ustar graygray00000000000000

now is the time for all good men to come to

wikitrans-1.3/testdata/deflist.texi0000644000175000017500000000014213340032704017445 0ustar graygray00000000000000 @table @asis @item item 1 definition 1 @item item 2 definition 2-1 definition 2-2 @end table wikitrans-1.3/testdata/bold.texi0000644000175000017500000000006013340032704016732 0ustar graygray00000000000000now is the time for @b{all good} men to come to wikitrans-1.3/testdata/colon.wiki0000644000175000017500000000042513340032704017123 0ustar graygray00000000000000: A colon (:) indents a line or paragraph. A newline starts a new paragraph. Should only be used on talk pages. For articles, you probably want the blockquote tag. : We use 1 colon to indent once. :: We use 2 colons to indent twice. ::: 3 colons to indent 3 times, and so on. wikitrans-1.3/testdata/dom.wiki0000644000175000017500000001401413340032704016567 0ustar graygray00000000000000[[cs:dom]] [[de:dom]] [[el:dom]] [[en:dom]] [[es:dom]] [[fr:dom]] [[ko:dom]] [[hr:dom]] [[io:dom]] [[id:dom]] [[is:dom]] [[it:dom]] [[ky:dom]] [[ku:dom]] [[lt:dom]] [[li:dom]] [[hu:dom]] [[nl:dom]] [[oc:dom]] [[om:dom]] [[pt:dom]] [[sl:dom]] [[fi:dom]] [[sv:dom]] [[vi:dom]] [[tr:dom]] [[uk:dom]] [[vo:dom]] [[zh:dom]] {{zobteż|DOM|Dom}} == dom ({{język polski}}) == [[Grafika:BrunnHeiligenstadtBauernhaus.jpg|thumb|right|200px|dom (1.1)]] {{wymowa}} {{lp}} {{IPA|dɔm}} {{audio|Pl-dom.ogg}} {{audio|dom.ogg}} {{lm}} {{IPA2|ˈdɔmɨ}} {{znaczenia}} ''rzeczownik, rodzaj męski'' : (1.1) [[budynek]] [[mieszkalny]] : (1.2) [[pomieszczenie]], [[miejsce]] [[stały|stałego]] [[zamieszkanie|zamieszkania]] ([[pobyt]]u) : (1.3) [[placówka]] [[społeczny|społeczna]] [[lub]] [[handlowy|handlowa]] : (1.4) [[ród]], [[rodzina]], [[dynastia]] {{odmiana}} {{lp}} dom, ~u, ~owi, ~, ~em, ~u, ~u; {{lm}} dom|y, ~ów, ~om, ~y, ~ami, ~ach, ~y {{przykłady}} : (1.1) ''[[w|W]] [[miasto|mieście]] [[wyrosnąć|wyrosło]] [[wiele]] [[nowy]]ch '''domów.''''' : (1.2) ''[[szkoła|Szkoła]] [[być|jest]] [[drugi]]m '''domem''' [[uczeń|ucznia]].'' : (1.3) ''[[za|Za]] [[kradzież]] [[dokonywać|dokonaną]] [[w]] '''domu''' [[handlowy]]m [[trafiać|trafił]] [[do]] '''domu''' [[poprawczy|poprawczego]].'' : (1.4) ''...[[Joanna]] Kowalska, [[z]] '''domu''' Nowak''. {{składnia}} {{kolokacje}} (1.1) [[budować]]/[[burzyć]]/[[remontować]] '''~''', [[stary]]/[[nawiedzony]] '''~'''; (1.2) [[uciec]] [[z]] '''~u''', [[nie]] [[mieć]] '''~u'''; (1.3) '''~''' [[poprawczy]]/[[handlowy]]/[[towarowy]]/[[studencki]]; (1.4) [[dziecko]] [[z]] [[dobry|dobrego]]/[[porządny|porządnego]]/[[biedny|biednego]] '''~u''' {{synonimy}} (1.1) [[blok]], [[budynek]], [[chałupa]], [[chata]], [[dach nad głową]], [[dwór]], [[gniazdo rodzinne]], [[kamienica]], [[mieszkanie]], [[ojcowska strzecha]], [[ognisko domowe]], [[pałac]], [[pielesze]], [[przybytek]], [[rezydencja]], [[siedlisko]], [[wieżowiec]], [[własny kąt]], [[zamek]] {{antonimy}} {{pokrewne}} {{rzecz}} [[bezdomność]], [[domator]]/[[domatorka]], [[domownik]], [[podomka]]; {{przym}} [[domowy]], [[przydomowy]] {{frazeologia}} (1.1) [[szklane domy]]; (1.2) [[dom boży]]; (1.3) [[dom dziecka]], [[dom publiczny]] {{etymologia}} {{uwagi}} {{tłumaczenia}} * angielski: (1.1) [[house]]; (1.2) [[home]] * arabski: (1.1) [[آلمنزل]]; (1.2) [[آلدار]] * białoruski: (1.1) [[дом]] {{m}} * bułgarski: (1.1) [[къща]] {{f}} * chorwacki: (1.1) [[kuća]] {{f}} * czeski: (1.1) [[dům]] {{m}} * dolnołużycki: (1.1) [[#dom (język dolnołużycki)|dom]] {{m}} * duński: (1.1) [[hus]] {{n}}; (1.2) [[hjem]] {{n}} * esperanto: (1.1) [[domo]]; (1.4) [[hejmo]] * fiński: (1.1) [[talo]]; (1.2) [[koti]] * francuski: (1.1-2,4) [[maison]] {{f}} * górnołużycki: (1.1) [[#dom (język górnołużycki)|dom]] {{m}} * grecki: (1.1-2,4) [[σπίτι]] {{n}}; (1.1-4) [[οίκος]] {{m}}; (1.3) [[κατάστημα]] {{n}} * hawajski: (1.1) [[hale]] * hiszpański: (1.1-4) [[casa]] {{f}} * hebrajski: (1.1-4) [[בית]] {{m}} (bajit) * interlingua: (1.1) [[casa]] * irlandzki: (1.1) [[teach]] {{m}} * islandzki: (1.1) [[hús]] {{n}}; (1.2) [[heimili]] {{n}}; (1.3) [[hús]] {{n}}; (1.4) [[ætt]] * japoński: (1.1) ([[うち]], uchi) * jidysz: (1.1) [[הויז]] {{n}} (hojz); (1.2) [[היים]] {{f}} (hejm); (1.3) ...[[בית]]־ {{n}} (bejs-...) * kaszubski: (1.1-2) [[dóm]] {{m}}, [[chëcz]] {{f}} * kataloński: (1.1-4) [[casa]] {{f}} * klingoński: (1.1) [[juh|juH]] * krymskotatarski: (1.1) [[üy]] * litewski: (1.1) [[namas]] {{m}} * macedoński: (1.1) [[куќа]] {{f}} * niemiecki: (1.1,3) [[Haus]] {{n}} (1.2) [[Heim]] {{n}} * norweski (bokmål): (1.1) [[hus#hus (język norweski)|hus]] {{n}} * perski: (1.1) [[خانِه|خانه]] (khāneh) * portugalski: (1.1,3) [[casa]] {{f}}; (1.2) [[casa]] {{f}}, [[lar]] {{m}}, [[residência]] {{f}} * rosyjski: (1.1) [[дом]] {{m}} * rumuński: (1.1) [[casă]] {{f}} * serbski: (1.) [[дом]] {{m}} * slovio: (1.1) [[domo]] * słowacki: (1.1) [[#dom (język słowacki)|dom]] * szwedzki: (1.1) [[hus#hus (język szwedzki)|hus]] {{n}} (1.2) [[hem]] {{n}} * turecki: (1.1) [[ev]] * ukraiński: (1.1-2) [[дім]] {{m}}; (1.3) [[будинок]] {{m}} * węgierski: (1.1) [[ház]] * włoski (1.1) [[casa]] {{f}} == dom ({{język dolnołużycki}}) == {{wymowa}} {{znaczenia}} ''rzeczownik, rodzaj męski'' : (1.1) [[#dom (język polski)|dom]] : (1.2) [[katedra]] {{odmiana}} {{lp}} dom, ~a, ~oju, ~, ~om, ~je; {{du}} ~a, ~owo, ~owa, ~a, ~oma, ~oma; {{lm}} ~y, ~ow, ~am, ~y, ~ami, ~ach {{przykłady}} : (1.1) ''[[wón|Wón]] [[byś|jo]] [[wóna|jej]] '''dom''' [[wugotowaś|wugótował]]''. → [[on#on (język polski)|On]] [[zapisać|zapisał]] [[ona|jej]] '''[[#dom (język polski)|dom]]''' [[w]] [[testament|testamencie]]. {{składnia}} {{kolokacje}} '''dom''' [[za]] [[stary#stary (język dolnołużycki)|starych]] [[luź]]i → [[dom]] [[starzec|starców]] {{synonimy}} {{antonimy}} {{pokrewne}} {{przysł}} [[doma]], [[domoj]] {{frazeologia}} {{etymologia}} (1.2) {{etym|niem|Dom}} {{uwagi}} == dom ({{esperanto}}) == {{wymowa}} {{znaczenia}} ''morfem'' : (1.1) [[#dom (język polski)|dom]] ''(budynek)'' {{odmiana}} {{przykłady}} : (1.1) {{składnia}} {{kolokacje}} {{synonimy}} {{antonimy}} {{pochodne}} {{rzecz}} [[domo]] {{frazeologia}} {{etymologia}} {{uwagi}} {{por|hejm}} == dom ({{język górnołużycki}}) == {{wymowa}} {{znaczenia}} ''rzeczownik, rodzaj męski'' : (1.1) [[#dom (język polski)|dom]] : (1.2) [[katedra]] {{odmiana}} {{przykłady}} : (1.1) {{składnia}} {{kolokacje}} {{synonimy}} {{antonimy}} {{pokrewne}} {{frazeologia}} {{etymologia}} {{uwagi}} == dom ({{slovio}}) == {{wymowa}} {{znaczenia}} ''rzeczownik'' : (1.1) [[#dom (język polski)|dom]] {{odmiana}} {{przykłady}} : (1.1) ''[[oni|Oni]] [[kupit|kupili]] [[starju]] '''dom''' [[vo]] [[malgrod]]''. → Oni [[kupić|kupili]] [[stary]] '''[[#dom (język polski)|dom]]''' [[na]] [[wieś|wsi]]. {{składnia}} {{kolokacje}} {{synonimy}} (1.1) [[domo]] {{antonimy}} {{pokrewne}} {{czas}} [[domovit]] {{frazeologia}} {{etymologia}} {{uwagi}} ''zapis cyrylicą'' [[дом]] wikitrans-1.3/testdata/it.text0000644000175000017500000000006013340032704016441 0ustar graygray00000000000000now is the time for _all good_ men to come to wikitrans-1.3/testdata/headings.text0000644000175000017500000000062313340032704017614 0ustar graygray00000000000000 ** Section headings _Headings_ organize your writing into sections. The Wiki software can automatically generate a table of contents from them. *** Subsection Using more "equals" (=) signs creates a subsection. **** A smaller subsection Don't skip levels, like from two to four equals signs. Start with 2 equals signs not 1 because 1 creates H1 tags which should be reserved for page title. wikitrans-1.3/testdata/nowiki-tag.texi0000644000175000017500000000001013340032704020056 0ustar graygray00000000000000A wikitrans-1.3/testdata/unlist.texi0000644000175000017500000000056513340032704017342 0ustar graygray00000000000000 @itemize @bullet @item @i{Unordered lists} are easy to do: @itemize @bullet @item Start every line with a star. @itemize @bullet @item More stars indicate a deeper level. @end itemize Previous item continues. @item A newline @end itemize @item in a list @end itemize marks the end of the list. @itemize @bullet @item Of course you can start again. @end itemize wikitrans-1.3/testdata/boldit2.wiki0000644000175000017500000000002213340032704017341 0ustar graygray00000000000000'''''a b'' c d''' wikitrans-1.3/testdata/colon.text0000644000175000017500000000042413340032704017143 0ustar graygray00000000000000 A colon (:) indents a line or paragraph. A newline starts a new paragraph. Should only be used on talk pages. For articles, you probably want the blockquote tag. We use 1 colon to indent once. We use 2 colons to indent twice. 3 colons to indent 3 times, and so on. wikitrans-1.3/testdata/itbold3.html0000644000175000017500000000003513340032704017347 0ustar graygray00000000000000

a b c d

wikitrans-1.3/testdata/itbold1.html0000644000175000017500000000003513340032704017345 0ustar graygray00000000000000

a b c d

wikitrans-1.3/testdata/numlist.texi0000644000175000017500000000034613340032704017514 0ustar graygray00000000000000 @enumerate @item @i{Numbered lists} are: @enumerate @item Very organized @item Easy to follow @end enumerate @end enumerate A newline marks the end of the list. @enumerate @item New numbering starts with 1. @end enumerate wikitrans-1.3/bin/0000755000175000017500000000000013342564531014074 5ustar graygray00000000000000wikitrans-1.3/bin/wikitrans0000755000175000017500000001544113342563647016051 0ustar graygray00000000000000#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008-2018 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from __future__ import print_function from __future__ import unicode_literals import sys import re import tempfile import xml.etree.ElementTree as etree from optparse import OptionParser try: from StringIO import StringIO except ImportError: from io import StringIO from wikitrans.wiki2html import HtmlWikiMarkup, HtmlWiktionaryMarkup from wikitrans.wiki2text import TextWikiMarkup, TextWiktionaryMarkup from wikitrans.wiki2texi import TexiWikiMarkup from wikitrans.wikimarkup import WikiMarkup from wikitrans.wikidump import DumpWikiMarkup # Set utf-8 as the default encoding for Python 2.7. # Trying to do so using encode('utf_8')/unicode, which is # supposed to be the right way, does not work in Python 2.7 # Simply calling sys.setdefaultencoding is not possible, # because, for some obscure reason, Python chooses to delete # this symbol from the namespace after setting its default # encoding in site.py. That's why reload is needed. try: reload(sys) sys.setdefaultencoding('utf-8') except: pass handlers = { 'dump': { 'default': DumpWikiMarkup, 'wiktionary': DumpWikiMarkup }, 'html': { 'default': HtmlWikiMarkup, 'wiktionary': HtmlWiktionaryMarkup }, 'text': { 'default': TextWikiMarkup, 'wiktionary': TextWiktionaryMarkup }, 'texi': { 'default': TexiWikiMarkup, 'wiktionary': TextWikiMarkup } } def setkw(option, opt, value, parser): if not parser.values.kwdict: parser.values.kwdict = {} (kw,sep,val) = value.partition('=') if val: parser.values.kwdict[kw] = val def setdebug(option, opt, value, parser): if not parser.values.kwdict: parser.values.kwdict = {} parser.values.kwdict['debug_level'] = value def getwiki(url, options): tmp = tempfile.NamedTemporaryFile() if sys.version_info[0] > 2: import urllib.request with urllib.request.urlopen(url) as u: root = etree.fromstring(u.read()) else: import urllib urllib.urlretrieve(url, tmp.name) root = etree.parse(tmp.name).getroot() ns = { 'wiki':'' } if 'version' in root.attrib: ns['wiki'] = 'http://www.mediawiki.org/xml/export-%s/' % root.attrib['version'] text = root.find('wiki:page/wiki:revision/wiki:text',ns) if text is None: print("no page/revision/text element in the downloaded page") exit(0) m = re.match('(?P(?:.+://)(?P.+?)\.(?Pwik(?:ipedia|tionary))\.org)', url) if m: options.lang = m.group('lang') options.kwdict['html_base'] = m.group('url') + '/wiki/' if m.group('root') == 'wiktionary': options.itype = 'wiktionary' options.kwdict['text'] = text.text.encode() def main(): usage = '%prog [OPTIONS] ARG' version = '%prog 1.3' description = """Translates MediaWiki documents markup to various other formats. If ARG looks like a URL, the wiki text to be converted will be downloaded from that URL. Otherwise, if --base-url is given, ARG is treated as the name of the page to get from the WikiMedia istallation at that URL. Otherwise, ARG is name of the file to read wiki material from. """ epilog = "Report bugs to: " parser = OptionParser(usage=usage, version=version, description=description, epilog=epilog) parser.add_option('-v', '--verbose', action="count", dest="verbose", help="verbose operation") parser.add_option('-I', '--input-type', action='store', type='string', dest='itype', default='default', help='set input document type ("default" or "wiktionary")') parser.add_option('-t', '--to', '--type', action='store', type='string', dest='otype', default='html', help='set output document type ("html" (default), "texi" or "text")') parser.add_option('-l', '--lang', action='store', type='string', dest='lang', default='en', help='set input document language') parser.add_option('-o', '--option', action='callback', callback=setkw, type='string', dest='kwdict', default={}, help='set keyword option for the parser class constructor') parser.add_option('-d', '--debug', action='callback', callback=setdebug, type='int', dest='kwdict', help='set debug level (0..100)') parser.add_option('-D', '--dump', action='store_const', const='dump', dest='otype', help='dump parse tree and exit; similar to --type=dump') parser.add_option('-b', '--base-url', action='store', type='string', dest='base_url', help='set base url') (options, args) = parser.parse_args() if len(args) == 1: if options.base_url: getwiki(options.base_url + '/wiki/Special:Export/' + args[0], options) elif args[0] == '-': options.kwdict['file'] = sys.stdin elif re.match('^(http|ftp)s?://',args[0]): getwiki(args[0], options) else: options.kwdict['filename'] = args[0] else: parser.error("bad number of arguments") options.kwdict['lang'] = options.lang # FIXME if options.otype == 'dump' and not 'indent' in options.kwdict: options.kwdict['indent'] = 2 if options.otype in handlers: if options.itype in handlers[options.otype]: markup = handlers[options.otype][options.itype](**options.kwdict) markup.parse() print("%s" % str(markup)) exit(0) else: print("input type %s is not supported for %s output" % (options.itype, options.otype)) else: print("unsupported output type: %s" % options.otype) exit(1) if __name__ == '__main__': main() wikitrans-1.3/setup.py0000644000175000017500000000345213342563720015041 0ustar graygray00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2008-2018 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from setuptools import setup, find_packages from codecs import open with open("README.rst", "r") as fh: long_description = fh.read() setup(name='wikitrans', version='1.3', author='Sergey Poznyakoff', author_email='gray@gnu.org', url='http://www.gnu.org.ua/projects/wikitrans', packages = find_packages(exclude=['contrib', 'docs', 'tests', 'testdata']), scripts=['bin/wikitrans'], license='GPL License', description='Wiki markup translator.', long_description=long_description, long_description_content_type="text/x-rst", platforms=['any'], test_suite='tests', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU General Public License (GPL)', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Text Processing :: Markup' ], keywords = 'mediawiki markup translation', ) wikitrans-1.3/PKG-INFO0000644000175000017500000001761413342564531014432 0ustar graygray00000000000000Metadata-Version: 2.1 Name: wikitrans Version: 1.3 Summary: Wiki markup translator. Home-page: http://www.gnu.org.ua/projects/wikitrans Author: Sergey Poznyakoff Author-email: gray@gnu.org License: GPL License Description: MediaWiki Markup Translator =========================== This package provides Python framework for translating WikiMedia articles to various formats. The present version supports conversions to plain text, HTML, and Texinfo formats. A command line converter utility is included. Classes ======= class ``WikiMarkup`` -------------------- A base class for all translator classes. Unless you plan extending wikitrans, you will never have to create objects of this class. Instead, you will be using one of its derived classes. Constructor arguments common for all derived classes: filename = *name* The file *name* is opened and used for input. file = *fd* An already opened file *fd* is used for input. text = *string* Input is taken from *string*, line by line. lang = *code* Specifies language version. Default is ``en``. This variable can be referred to as ``%(lang)s`` in the keyword arguments below. html_base = *url* Base URL for cross-references. Default is ``http://%(lang)s.wikipedia.org/wiki/``. image_base = *url* Base URL for images. Default is ``http://upload.wikimedia.org/wikipedia/commons/thumb/a/bf`` media_base = *url* Base URL for media files. Default is ``http://www.mediawiki.org/xml/export-0.3`` debug_level = *int* Debug verbosity level (0 - no debug info, 100 - excessively copious debug messages). Default is 0. strict = *bool* Strict parsing mode. Throw exceptions on syntax errors. Default is False. class ``TextWikiMarkup`` ------------------------ Translates material in Wiki markup language to plain text. Usage:: from WikiTrans.wiki2text import TextWikiMarkup markup = TextWikiMarkup(filename='input.txt') markup.parse() print(str(markup)) Specific constructor arguments: width = *N* Limit output width to *N* columns. Default is 78. show_urls = *bool* Whether or not to show the URLs links refer to. If *bool* is ``True`` (the default), a URL will be displayed in parentheses next to the link text. If ``False``, only the link text will be displayed. class ``TextWiktionaryMarkup`` ------------------------------ Translate material from wiktionary to plain text form. This is supposed to provide a wiktionary-specific form of ``TextWikiMarkup``. Currently, this class differs from ``TextWikiMarkup`` only in that the default value for ``html_base`` is ``http://%(lang)s.wikipedia.org/wiki/``. class ``TexiWikiMarkup`` ------------------------ Translate Wiki markup to Texinfo source. Usage:: from WikiTrans.wiki2texi import TexiWikiMarkup markup = TexiWikiMarkup(filename='input.txt') markup.parse() print(str(markup)) Two markup-specific keywords control the sectioning model used. sectioning_model = *model* Selects the Texinfo sectioning model for the output document. Possible values are: ``numbered`` Top of document is marked with ``@top``. Headings (``=``, ``==``, ``===``, etc) produce ``@chapter``, ``@section``, ``@subsection``, etc. ``unnumbered`` Unnumbered sectioning: ``@top``, ``@unnumbered``, ``@unnumberedsec``, ``@unnumberedsubsec``. ``appendix`` Sectioning suitable for appendix entries: ``@top``, ``@appendix``, ``@appendixsec``, ``@appendixsubsec``, etc. ``heading`` Use heading directives to reflect sectioning: ``@majorheading``, ``@chapheading``, ``@heading``, ``@subheading``, etc. sectioning_start = *n* Shift resulting heading level by *n* positions. For example, supposing ``sectioning_model=numbered``, ``== A ==`` will produce ``@section A`` on output. If ``sectioning_start=1`` is also given, this directive will produce ``@subsection A`` instead. class ``HtmlWikiMarkup`` ------------------------ Translates Wiki markup to HTML. Usage:: from WikiTrans.wiki2html import HtmlWikiMarkup markup = HtmlWikiMarkup(filename='input.txt') markup.parse() print(str(markup)) Supported keywords are same as for ``WikiMarkup`` class. class ``HtmlWiktionaryMarkup`` ------------------------------ Translate material from wiktionary to HTML form. This is supposed to provide a wiktionary-specific form of ``HtmlWikiMarkup``. Currently both classes are equivalent, except that the default value for ``html_base`` in ``HtmlWiktionaryMarkup`` is ``http://%(lang)s.wikipedia.org/wiki/``. The ``wikitrans`` utility ========================= This command line utility converts the supplied text to selected output format. The usage syntax is:: wikitrans [OPTIONS] ARG If ARG looks like a URL, the wiki text to be converted will be downloaded from that URL. Otherwise, if the ``--base-url=URL`` option is given, ARG is treated as the name of the page to get from the WikiMedia istallation at ``URL``. Otherwise, ARG is treated as the name of the file to read wiki material from. Examples:: wikitrans text.wiki wikitrans --base-url http://en.wiktionary.org door wikitrans https://en.wiktionary.org/wiki/Special:Export/door Options are: ``--version`` Show program's version number and exit. ``-h``, ``--help`` Show a short usage summary and exit. ``-v``, ``--verbose`` Verbose operation. ``-I ITYPE``, ``--input-type=ITYPE`` Set input document type. *ITYPE* is one of: ``default`` or ``wiktionary``. ``-t OTYPE``, ``--to=OTYPE``, ``--type=OTYPE`` Set output document type (``html`` (the default), ``texi``, ``text``, or ``dump``). ``-l LANG``, ``--lang=LANG`` Set input document language. ``-o KW=VAL``, ``--option=KW=VAL`` Pass the keyword argument ``KW=VAL`` to the parser class constructor. ``-d DEBUG``, ``--debug=DEBUG`` Set debug level (0..100). ``-D``, ``--dump`` Dump parse tree and exit; same as ``--type=dump``. ``-b URL``, ``--base-url=URL`` Set base url. Note: when using ``--base-url`` or passing URL as an argument (2nd and 3rd use cases above), if the URL is in 'wikipedia.org' or 'wiktionary.org' domain, the options ``--input-type``, and ``--lang`` are set automatically. Keywords: mediawiki markup translation Platform: any Classifier: Development Status :: 4 - Beta Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU General Public License (GPL) Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Text Processing :: Markup Description-Content-Type: text/x-rst wikitrans-1.3/MANIFEST.in0000644000175000017500000000030313340061133015042 0ustar graygray00000000000000exclude .gitignore include COPYING.txt include CHANGES.txt recursive-include testdata *.wiki recursive-include testdata *.texi recursive-include testdata *.text recursive-include testdata *.html wikitrans-1.3/wikitrans.egg-info/0000755000175000017500000000000013342564531017031 5ustar graygray00000000000000wikitrans-1.3/wikitrans.egg-info/dependency_links.txt0000644000175000017500000000000113342564531023077 0ustar graygray00000000000000 wikitrans-1.3/wikitrans.egg-info/top_level.txt0000644000175000017500000000001213342564531021554 0ustar graygray00000000000000wikitrans wikitrans-1.3/wikitrans.egg-info/SOURCES.txt0000644000175000017500000000417113342564531020720 0ustar graygray00000000000000CHANGES.txt COPYING.txt MANIFEST.in README.rst setup.py bin/wikitrans testdata/bold.html testdata/bold.texi testdata/bold.text testdata/bold.wiki testdata/boldit0.html testdata/boldit0.texi testdata/boldit0.wiki testdata/boldit1.html testdata/boldit1.texi testdata/boldit1.text testdata/boldit1.wiki testdata/boldit2.html testdata/boldit2.texi testdata/boldit2.text testdata/boldit2.wiki testdata/boldit3.html testdata/boldit3.texi testdata/boldit3.text testdata/boldit3.wiki testdata/colon.html testdata/colon.texi testdata/colon.text testdata/colon.wiki testdata/deflist.html testdata/deflist.texi testdata/deflist.text testdata/deflist.wiki testdata/dom.wiki testdata/header0.texi testdata/header0.wiki testdata/headings.html testdata/headings.texi testdata/headings.text testdata/headings.wiki testdata/hz.html testdata/hz.texi testdata/hz.text testdata/hz.wiki testdata/it.html testdata/it.texi testdata/it.text testdata/it.wiki testdata/itbold1.html testdata/itbold1.texi testdata/itbold1.text testdata/itbold1.wiki testdata/itbold2.html testdata/itbold2.texi testdata/itbold2.text testdata/itbold2.wiki testdata/itbold3.html testdata/itbold3.texi testdata/itbold3.text testdata/itbold3.wiki testdata/link.texi testdata/link.wiki testdata/nowiki-ind.html testdata/nowiki-ind.text testdata/nowiki-ind.wiki testdata/nowiki-tag.html testdata/nowiki-tag.texi testdata/nowiki-tag.text testdata/nowiki-tag.wiki testdata/nowiki.html testdata/nowiki.texi testdata/nowiki.text testdata/nowiki.wiki testdata/numlist.html testdata/numlist.texi testdata/numlist.text testdata/numlist.wiki testdata/para.html testdata/para.texi testdata/para.text testdata/para.wiki testdata/reclink.wiki testdata/unlist.html testdata/unlist.texi testdata/unlist.text testdata/unlist.wiki tests/__init__.py tests/test_html.py tests/test_texi.py tests/test_text.py tests/wikitest.py wikitrans/__init__.py wikitrans/wiki2html.py wikitrans/wiki2texi.py wikitrans/wiki2text.py wikitrans/wikidump.py wikitrans/wikimarkup.py wikitrans/wikins.py wikitrans/wikitoken.py wikitrans.egg-info/PKG-INFO wikitrans.egg-info/SOURCES.txt wikitrans.egg-info/dependency_links.txt wikitrans.egg-info/top_level.txtwikitrans-1.3/wikitrans.egg-info/PKG-INFO0000644000175000017500000001761413342564531020137 0ustar graygray00000000000000Metadata-Version: 2.1 Name: wikitrans Version: 1.3 Summary: Wiki markup translator. Home-page: http://www.gnu.org.ua/projects/wikitrans Author: Sergey Poznyakoff Author-email: gray@gnu.org License: GPL License Description: MediaWiki Markup Translator =========================== This package provides Python framework for translating WikiMedia articles to various formats. The present version supports conversions to plain text, HTML, and Texinfo formats. A command line converter utility is included. Classes ======= class ``WikiMarkup`` -------------------- A base class for all translator classes. Unless you plan extending wikitrans, you will never have to create objects of this class. Instead, you will be using one of its derived classes. Constructor arguments common for all derived classes: filename = *name* The file *name* is opened and used for input. file = *fd* An already opened file *fd* is used for input. text = *string* Input is taken from *string*, line by line. lang = *code* Specifies language version. Default is ``en``. This variable can be referred to as ``%(lang)s`` in the keyword arguments below. html_base = *url* Base URL for cross-references. Default is ``http://%(lang)s.wikipedia.org/wiki/``. image_base = *url* Base URL for images. Default is ``http://upload.wikimedia.org/wikipedia/commons/thumb/a/bf`` media_base = *url* Base URL for media files. Default is ``http://www.mediawiki.org/xml/export-0.3`` debug_level = *int* Debug verbosity level (0 - no debug info, 100 - excessively copious debug messages). Default is 0. strict = *bool* Strict parsing mode. Throw exceptions on syntax errors. Default is False. class ``TextWikiMarkup`` ------------------------ Translates material in Wiki markup language to plain text. Usage:: from WikiTrans.wiki2text import TextWikiMarkup markup = TextWikiMarkup(filename='input.txt') markup.parse() print(str(markup)) Specific constructor arguments: width = *N* Limit output width to *N* columns. Default is 78. show_urls = *bool* Whether or not to show the URLs links refer to. If *bool* is ``True`` (the default), a URL will be displayed in parentheses next to the link text. If ``False``, only the link text will be displayed. class ``TextWiktionaryMarkup`` ------------------------------ Translate material from wiktionary to plain text form. This is supposed to provide a wiktionary-specific form of ``TextWikiMarkup``. Currently, this class differs from ``TextWikiMarkup`` only in that the default value for ``html_base`` is ``http://%(lang)s.wikipedia.org/wiki/``. class ``TexiWikiMarkup`` ------------------------ Translate Wiki markup to Texinfo source. Usage:: from WikiTrans.wiki2texi import TexiWikiMarkup markup = TexiWikiMarkup(filename='input.txt') markup.parse() print(str(markup)) Two markup-specific keywords control the sectioning model used. sectioning_model = *model* Selects the Texinfo sectioning model for the output document. Possible values are: ``numbered`` Top of document is marked with ``@top``. Headings (``=``, ``==``, ``===``, etc) produce ``@chapter``, ``@section``, ``@subsection``, etc. ``unnumbered`` Unnumbered sectioning: ``@top``, ``@unnumbered``, ``@unnumberedsec``, ``@unnumberedsubsec``. ``appendix`` Sectioning suitable for appendix entries: ``@top``, ``@appendix``, ``@appendixsec``, ``@appendixsubsec``, etc. ``heading`` Use heading directives to reflect sectioning: ``@majorheading``, ``@chapheading``, ``@heading``, ``@subheading``, etc. sectioning_start = *n* Shift resulting heading level by *n* positions. For example, supposing ``sectioning_model=numbered``, ``== A ==`` will produce ``@section A`` on output. If ``sectioning_start=1`` is also given, this directive will produce ``@subsection A`` instead. class ``HtmlWikiMarkup`` ------------------------ Translates Wiki markup to HTML. Usage:: from WikiTrans.wiki2html import HtmlWikiMarkup markup = HtmlWikiMarkup(filename='input.txt') markup.parse() print(str(markup)) Supported keywords are same as for ``WikiMarkup`` class. class ``HtmlWiktionaryMarkup`` ------------------------------ Translate material from wiktionary to HTML form. This is supposed to provide a wiktionary-specific form of ``HtmlWikiMarkup``. Currently both classes are equivalent, except that the default value for ``html_base`` in ``HtmlWiktionaryMarkup`` is ``http://%(lang)s.wikipedia.org/wiki/``. The ``wikitrans`` utility ========================= This command line utility converts the supplied text to selected output format. The usage syntax is:: wikitrans [OPTIONS] ARG If ARG looks like a URL, the wiki text to be converted will be downloaded from that URL. Otherwise, if the ``--base-url=URL`` option is given, ARG is treated as the name of the page to get from the WikiMedia istallation at ``URL``. Otherwise, ARG is treated as the name of the file to read wiki material from. Examples:: wikitrans text.wiki wikitrans --base-url http://en.wiktionary.org door wikitrans https://en.wiktionary.org/wiki/Special:Export/door Options are: ``--version`` Show program's version number and exit. ``-h``, ``--help`` Show a short usage summary and exit. ``-v``, ``--verbose`` Verbose operation. ``-I ITYPE``, ``--input-type=ITYPE`` Set input document type. *ITYPE* is one of: ``default`` or ``wiktionary``. ``-t OTYPE``, ``--to=OTYPE``, ``--type=OTYPE`` Set output document type (``html`` (the default), ``texi``, ``text``, or ``dump``). ``-l LANG``, ``--lang=LANG`` Set input document language. ``-o KW=VAL``, ``--option=KW=VAL`` Pass the keyword argument ``KW=VAL`` to the parser class constructor. ``-d DEBUG``, ``--debug=DEBUG`` Set debug level (0..100). ``-D``, ``--dump`` Dump parse tree and exit; same as ``--type=dump``. ``-b URL``, ``--base-url=URL`` Set base url. Note: when using ``--base-url`` or passing URL as an argument (2nd and 3rd use cases above), if the URL is in 'wikipedia.org' or 'wiktionary.org' domain, the options ``--input-type``, and ``--lang`` are set automatically. Keywords: mediawiki markup translation Platform: any Classifier: Development Status :: 4 - Beta Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU General Public License (GPL) Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Text Processing :: Markup Description-Content-Type: text/x-rst wikitrans-1.3/wikitrans/0000755000175000017500000000000013342564531015337 5ustar graygray00000000000000wikitrans-1.3/wikitrans/__init__.py0000644000175000017500000000151013340032704017433 0ustar graygray00000000000000#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008-2018 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . __all__ = [ "wikitoken", "wikimarkup", "wikidump", "wiki2html", "wiki2text", "wiki2texi", "wikins" ] wikitrans-1.3/wikitrans/wiki2html.py0000644000175000017500000002345713340032704017624 0ustar graygray00000000000000#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008-2018 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . """ Wiki markup to HTML translator. Classes: HtmlWikiMarkup -- Converts Wiki material to HTML. HtmlWiktionaryMarkup -- Reserved for future use. Currently does the same as HtmlWikiMarkup. """ from __future__ import print_function from wikitrans.wikimarkup import * from wikitrans.wikitoken import * from wikitrans.wikins import wiki_ns_re, wiki_ns import re try: from urllib import quote as url_quote except ImportError: from urllib.parse import quote as url_quote try: from html import escape as html_escape except ImportError: from cgi import escape as html_escape __all__ = [ "HtmlWikiMarkup", "HtmlWiktionaryMarkup" ] class HtmlSeqNode(WikiSeqNode): def format(self): s = '' for x in self.content: s += x.format() return s class HtmlLinkNode(HtmlSeqNode): def format(self): arg = self.content[0].format() text = None if len(self.content) > 1: s = [x for x in map(lambda x: x.format(), self.content)] if s[0] == 'disambigR' or s[0] == 'wikiquote': return "" elif len(s) > 1 and s[1] == 'thumb': return "" text = '' + s[1] + '' if self.type == 'TMPL': if re.match("t[+-]$", s[0]): if len(s) > 2: text = s[2] elif s[0] == "term": text = self.parser.tmpl_term(s) elif s[0] == "proto": text = self.parser.tmpl_proto(s) return text (qual, sep, tgt) = arg.partition(':') if tgt != '': ns = self.parser.wiki_ns_name(qual) if ns: if ns == 'NS_IMAGE': return '' elif ns == 'NS_MEDIA': tgt = self.parser.media_base + '/' + tgt else: tgt = self.parser.mktgt(tgt) elif self.type == 'LINK' and qual in self.parser.langtab: tgt = self.parser.mktgt(tgt, qual) if not text or text == '': text = self.parser.langtab[qual] else: tgt = self.parser.mktgt(tgt) else: tgt = self.parser.mktgt(arg) return "%s" % (tgt, text if (text and text != '') else arg) class HtmlRefNode(WikiRefNode): def format(self): target = self.ref text = self.content.format() return "%s" % ( target, text if (text and text != '') else target ) class HtmlFontNode(HtmlSeqNode): def format(self): comm = { 'IT': 'i', 'BOLD': 'b' } s = '<%s>' % comm[self.type] for x in self.content: s += x.format() s += '' % comm[self.type] return s class HtmlTextNode(HtmlSeqNode): def format(self): if isinstance(self.content, list): s = ''.join(self.content) else: s = html_escape(self.content, quote=False) return s class HtmlHdrNode(WikiHdrNode): def format(self): level = self.level if level > 6: level = 6 return "%s\n\n" % (level, self.content.format(), level) class HtmlBarNode(WikiNode): def format(self): return "
\n" class HtmlEnvNode(WikiEnvNode): def format(self): type = self.envtype lev = self.level if lev > 4: lev = 2 string = "" for s in self.content: n = s.subtype; string += "<%s>%s" % (self.parser.envt[type]["elt"][n], s.content.format(), self.parser.envt[type]["elt"][n]) return "<%s>%s" % (self.parser.envt[type]["hdr"], string, self.parser.envt[type]["hdr"]) return string class HtmlTagNode(WikiTagNode): def format(self): if self.tag == 'code': self.parser.nested += 1 s = self.content.format() self.parser.nested -= 1 return '
' + s + '
' #FIXME elif self.tag == 'ref': n = self.idx+1 return '%d' % (n, n, n, n) elif self.tag == 'references': s = '
\n' s += '
    \n' n = 0 for ref in self.parser.references: n += 1 s += ('
  1. ' + '' + '^' + '' + '' + ref.content.format() + '' + '
  2. \n') % (n, n) s += '
\n
\n' return s else: s = '<' + self.tag if self.args: s += ' ' + str(self.args) s += '>' s += self.content.format() return s + '' class HtmlParaNode(HtmlSeqNode): def format(self): return "

" + super(HtmlParaNode, self).format() + "

\n" class HtmlPreNode(HtmlSeqNode): def format(self): s = super(HtmlPreNode, self).format() if self.parser.nested: return s else: return '
' + s + '
' class HtmlIndNode(WikiIndNode): def format(self): return ("
" * self.level) + self.content.format() + "
" * self.level class HtmlWikiMarkup(WikiMarkup): """A Wiki markup to HTML translator class. Usage: x = HtmlWikiMarkup(file="input.wiki") # Parse the input: x.parse() # Print it as HTML: print(str(x)) Known bugs: * [[official position]]s Final 's' gets after closing tag. Should be before. """ nested = 0 references = [] def __init__(self, *args, **kwargs): """Create a HtmlWikiMarkup object. HtmlWikiMarkup([filename=FILE],[file=FD],[text=STRING],[lang=CODE], [html_base=URL],[image_base=URL],[media_base=URL]) The arguments have the same meaning as in the WikiMarkup constructor. """ super(HtmlWikiMarkup, self).__init__(*args, **kwargs) self.token_class['LINK'] = HtmlLinkNode self.token_class['TMPL'] = HtmlLinkNode self.token_class['REF'] = HtmlRefNode self.token_class['IT'] = HtmlFontNode self.token_class['BOLD'] = HtmlFontNode self.token_class['HDR'] = HtmlHdrNode self.token_class['BAR'] = HtmlBarNode self.token_class['ENV'] = HtmlEnvNode self.token_class['TAG'] = HtmlTagNode self.token_class['PARA'] = HtmlParaNode self.token_class['PRE'] = HtmlPreNode self.token_class['IND'] = HtmlIndNode self.token_class['TEXT'] = HtmlTextNode self.token_class['SEQ'] = HtmlSeqNode def wiki_ns_name(self, str): if str in wiki_ns[self.lang]: return wiki_ns[self.lang][str] elif str in wiki_ns_re[self.lang]: for elt in wiki_ns_re[self.lang][str]: if str.beginswith(elt[0]) and str.endswith(elt[1]): return elt[2] return None envt = { "unnumbered": { "hdr": "ul", "elt": ["li"] }, "numbered": { "hdr": "ol", "elt": ["li"] }, "defn": { "hdr": "dl", "elt": ["dt","dd"] } } def mktgt(self, tgt, lang = None): if not lang: lang = self.lang return self.html_base % { 'lang' : lang } + url_quote(tgt) def tmpl_term(self, s): if len(s) == 2: return s[1] text = None trans = None for x in s[1:]: m = re.match('(\w+)=', x) if m: if m.group(1) == "tr": trans = x[m.end(1)+1:] elif not text: text = x if text: if trans: text += ' [' + trans + ']' return text def tmpl_proto(self, s): text = 'Proto-' + s[1] + '' if len(s) >= 4: n = 0 for x in s[2:-2]: if n > 0: text += ',' n += 1 text += ' ' + x + '' text += ' (' + s[-2] + ')' return text def __str__(self): str = "" for elt in self.tree: str += elt.format() return str class HtmlWiktionaryMarkup(HtmlWikiMarkup): """A class for translating Wiktionary articles into HTML. Reserved for future use. Currently does the same as HtmlWikiMarkup. """ html_base='http://%(lang)s.wiktionary.org/wiki/' wikitrans-1.3/wikitrans/wikimarkup.py0000644000175000017500000014000013342561446020071 0ustar graygray00000000000000#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008-2018 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . """ Wiki markup parser. This module provides two class: WikiMarkupParser: An abstract parser class, which serves as a base class for all markup classes in this package. WikiMarkup A subclass of the above, providing basic input method. """ from __future__ import print_function import sys import re from types import * from wikitrans.wikitoken import * __all__ = [ "WikiMarkupParser", "WikiMarkup", "TagAttributes", "TagAttributeSyntaxError" ] class UnexpectedTokenError(Exception): def __init__(self, value): self.value = value class TagAttributeSyntaxError(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) class TagAttributes(object): """A dictionary-like collection of tag attributes. Example: attr = TagAttributes('href="foo" length=2') if 'href' in attr: print(x['href']) # returns "foo" for a in attr: ... """ attrstart = re.compile("^(?P[a-zA-Z0-9_-]+)(?P=\")?") valseg = re.compile("^[^\\\"]+") tab = {} printable = None def __init__(self, string): if not string: self.printable = '' return self.printable = string s = string self.tab = {} while s != '': s = s.strip() m = self.attrstart.match(s) if m: name = m.group('attr') val = '' s = s[m.end(0):] if m.group('eq'): while 1: m = self.valseg.match(s) val += m.group(0) s = s[m.end(0):] if s[0] == '\\': val += s[1] s += 2 elif s[0] == '"': s = s[1:] break else: val = 1 self.tab[name] = val else: raise TagAttributeSyntaxError(s) def __len__(self): return len(self.tab) def __getitem__(self, key): return self.tab[key] def __contains__(self, key): return key in self.tab def __iter__(self): for key in self.tab: yield(key) def has_key(self, key): return self.__contains__(key) def __setitem__(self, key, value): self.tab[key] = value def __delitem__(self, key): del self.tab[key] def __str__(self): return self.printable def __repr__(self): return self.printable class WikiMarkupParser(object): """Parser for Wiki markup language. Given input in Wiki markup language creates an abstract parse tree for it. This is a base class for actual parsers. The subclasses must provide the input method. Public methods: parse() -- parse the input. Abstract methods (must be overridden by the subclass): input() -- returns next physical line from the input material. Public attributes: Input: debug_level -- debug verbosity level (0 - no debug info, 100 - excessively copious debug messages). Default is 0. strict -- if True, parser will throw exception upon encountering invalid markup tag (mostly for future use) Output: tree -- constructed parse tree (a subclass of WikiNode) """ delim = re.compile("^==+[ \t]*|[ \t]*==+[ \t]*$|(^----$)|^\\*+|^#+|^[;:]+|(\\[\\[)|\\[|(\\{\\{)|(\\]\\])|\\]|(\\}\\})|\\||(\\'\\'\\'?)|<") otag = re.compile("<(?P[a-zA-Z0-9_]+)(?:\s+(?P[^/][^>]+))?\s*(?P/)?>") ctag = re.compile("[a-zA-Z0-9_]+)\s*>") refstart = re.compile("^https?://") close_delim = { '[': ']', '[[': ']]', '{{': '}}' } # Environment types: envtypes = { "*": [ "unnumbered", 0 ], "#": [ "numbered", 0 ], ";": [ "defn", 0 ], ":": [ "defn", 1 ] } toklist = None tokind = 0 newline = 0 tree = None tags = [ 'code', 'nowiki', 'tt', 'div', 'ref', 'references' ] debug_level = 0 strict = False def dprint(self, lev, fmt, *argv): """If current debug level is greater than or equal to lev, print *argv according to format. """ if self.debug_level >= lev: for l in (fmt % argv).split('\n'): print("[DEBUG] %s" % l) inline_delims = [ "''", "'''", "[", "]", "[[", "]]", "{{", "}}", "|" ] token_class = {} def _new_node(self, **kwarg): return self.token_class[kwarg['type']](self, **kwarg) def tokread(self): """Read next token from the input. Return it as a subclass of WikiNode.""" line = None pos = 0 while 1: if (not line or pos == len(line)): try: line = self.input() pos = 0 except StopIteration: line = u'' if not line or line == "": yield(self._new_node(type='NIL')) break if line == '\n': yield(self._new_node(type='NL')) line = None continue self.dprint(100, "LINE: %s", line[pos:]) m = self.delim.search(line, pos) if m: if (pos < m.start(0)): yield(self._new_node(type='TEXT', content=line[pos:m.start(0)])) pos = m.start(0) t = None if line[m.start(0)] == '<': m = self.otag.match(line, pos) if m: pos = m.end(0) if m.group('tag') == 'nowiki': if not m.group('closed'): while 1: try: m = self.ctag.search(line, pos) if m and m.group('tag') == 'nowiki': yield(self._new_node(type='TEXT', content=line[pos:m.start(0)] )) pos = m.end(0) break yield(self._new_node(type='TEXT', content=line[pos:])) line = self.input() pos = 0 except StopIteration: break continue elif m.group('tag') in self.tags: try: yield(self._new_node(type='OTAG', tag=m.group('tag'), isblock=(line[pos] == '\n'), args=TagAttributes(m.group('args')))) if m.group('closed'): yield(self._new_node(type='CTAG', tag=m.group('tag'))) except TagAttributeSyntaxError: yield(self._new_node(type='TEXT', content=m.group(0))) continue else: yield(self._new_node(type='TEXT', content=m.group(0))) continue else: m = self.ctag.match(line, pos) if m: if m.group('tag') in self.tags: yield(self._new_node(type='CTAG', tag=m.group('tag'))) else: yield(self._new_node(type='TEXT', content=m.group(0))) pos = m.end(0) continue else: yield(self._new_node(type='TEXT', content=line[pos:pos+1])) pos += 1 continue else: pos = m.end(0) content = m.group(0) if content[0] in self.envtypes: node = self._new_node(type='DELIM', content=content, isblock=True, continuation=pos < len(line) and line[pos] == ":") if node.continuation: node.content += node.content[0] pos += 1 yield(node) while pos < len(line) and line[pos] in [' ', '\t']: pos += 1 else: yield(self._new_node(type='DELIM', isblock=(content.strip() not in self.inline_delims), content=content.strip())) continue if line: if line[-1] == '\n': if line[pos:-1] != '': yield(self._new_node(type='TEXT', content=line[pos:-1])) yield(self._new_node(type='NL')) else: yield(self._new_node(type='TEXT', content=line[pos:])) line = None def input(self): """Return next physical line from the input. This method must be overridden by the subclass. """ return None def swaptkn(self, i, j): """Swap tokens at indices i and j in toklist.""" self.dprint(80, "SWAPPING %s <-> %s", i, j) x = self.toklist[i] self.toklist[i] = self.toklist[j] self.toklist[j] = x def tokenize(self): """Tokenize the input. Read tokens from the input (supplied by the input() method). Place the obtained tokens in the toklist array. """ self.toklist = [] for tok in self.tokread(): self.dprint(100, "TOK: %s", tok) self.toklist.append(tok) # Determine and fix up the ordering of bold and italic markers # There are three possible cases: # # 1a. '''a b ''c'' d''' # 1b. ''a b '''c''' d'' # # 2a. '''''a b'' c d''' # 2b. '''''a b''' c d'' # # 3a. '''a b ''c d''''' # 3b. ''a b '''c d''''' stack = [] for i in range(0, len(self.toklist)): if (self.toklist[i].type == 'DELIM' and (self.toklist[i].content == "''" or self.toklist[i].content == "'''")): if len(stack) > 0: if self.toklist[stack[-1]].content == self.toklist[i].content: # Case 1: just pop the matching delimiter off the stack stack.pop() elif len(stack) == 2 and stack[-2] + 1 == stack[-1]: # Case 2: swap delimiters saved on stack ... self.swaptkn(stack[-2], stack[-1]) # and pop off the matching one stack.pop() elif (i < len(self.toklist) and self.toklist[i+1].type == 'DELIM' and self.toklist[stack[-1]].content == self.toklist[i+1].content): # Case 3: swap current and next tokens self.swaptkn(i, i+1) # and pop off the matching one stack.pop() else: # Push the token on stack stack.append(i) else: # Push the token on stack stack.append(i) # Redefine all non-matched tokens as TEXT for i in stack: # FIXME: How to convert node to TEXT? self.toklist[i] = self._new_node(type='TEXT', content=str(self.toklist[i])) mark = [] def push_mark(self): """Save the current token index on stack.""" self.mark.append(self.tokind) def pop_mark(self): """Restore the token index from top of stack.""" self.tokind = self.mark.pop() def clear_mark(self): """Forget the last mark.""" self.mark.pop() def lookahead(self, off=0): """Peek a token at index (tokind+off).""" tok = self.toklist[self.tokind+off] self.dprint(20, "lookahead(%s): %s", off, tok) return tok def setkn(self, val): """Store token val at the current token index.""" self.toklist[self.tokind] = val def getkn(self): """Get next token from the toklist. Advance tokind.""" self.newline = self.tokind == 0 or self.toklist[self.tokind-1].type == 'NL' if self.tokind == len(self.toklist): return self._new_node(type='NIL') tok = self.toklist[self.tokind] self.tokind = self.tokind + 1 self.dprint(20, "getkn: %s", tok) return tok def ungetkn(self, tok=None): """Unget the last read token. Decrease the tokind by one, so the last read token will be read again. If optional argument is supplied and is not None, store it in the toklist in place of the current token. """ self.tokind = self.tokind - 1 self.newline = self.tokind == 0 or self.toklist[self.tokind-1].type == 'NL' if tok: self.toklist[self.tokind] = tok self.dprint(20, "ungetkn: %s", tok) return self.toklist[self.tokind] def fixuptkn(self, tok): """Replace the recently read token by tok.""" if self.tokind == 0: raise IndexError('WikiMarkupParser.fixuptkn called at start of input') self.toklist[self.tokind-1] = tok return tok def dump(self, tree, file=sys.stdout): """Dump the tree to file, node by node.""" for node in tree: file.write(str(node)) file.write('\n') def is_block_end(self, tok): """Return True if tok ends a block environment.""" if tok.type == 'NIL': return True elif tok.type == 'NL': if self.lookahead().type == 'NIL': return True elif self.lookahead().type == 'NL': self.getkn() return True elif tok.type in ['DELIM', 'CTAG', 'TAG']: if tok.isblock: self.ungetkn(tok) return True return False def parse_para(self, tok): """Read paragraph starting at tok.""" self.dprint(80, "ENTER parse_para: %s", tok) acc = { 'seq': [], 'textlist': [] } def flush(): if acc['textlist']: acc['seq'].append(self._new_node(type='TEXT', content=''.join(acc['textlist']))) acc['textlist'] = [] if (isinstance(tok, WikiContentNode) and isinstance(tok.content, str) and re.match("^[ \t]", tok.content)): type = 'PRE' rx = re.compile("^\S") else: type = 'PARA' rx = re.compile("^[ \t]") while not self.is_block_end(tok): if tok.type == 'TEXT': if rx and self.newline and rx.match(tok.content): self.ungetkn() break acc['textlist'].append(tok.content) elif tok.type == 'NL': acc['textlist'].append('\n') elif tok.type == 'OTAG': flush() acc['seq'].append(self.parse_tag(tok)) elif tok.type == 'DELIM': flush() acc['seq'].append(self.parse_inline_delim(tok)) else: if self.strict: raise UnexpectedTokenError(tok) # FIXME: Another possible variant of handling this case is to # convert tok to TEXT node and append it to acc['seq'] tok = self.getkn() flush() if acc['seq']: tok = self._new_node(type=type, content=acc['seq']) else: tok = None self.dprint(80, "LEAVE parse_para=%s", tok) return tok def parse_block_delim(self, tok): """Parse block environment starting at tok.""" self.dprint(80, "ENTER parse_block_delim") assert(tok.type == 'DELIM') if tok.content == "----": node = self._new_node(type = 'BAR') elif tok.content[0:2] == "==": node = self.parse_header(tok) if not node: tok = self.ungetkn(self._new_node(type='TEXT', content=tok.content)) elif tok.content[0] in self.envtypes: node = None if tok.content[0] == ':': t = self.lookahead(-2) if not (t.type == 'DELIM' and t.content == ';'): node = self.parse_indent(tok) if not node: node = self.parse_env(tok) else: self.ungetkn(tok) node = None self.dprint(80, "LEAVE parse_block_delim=%s", node) return node def parse_line(self): """Parse the input line.""" self.dprint(80, "ENTER parse_line") list = [] while True: tok = self.getkn() if tok.type == 'NL' or tok.type == 'NIL': break elif tok.type == 'TEXT': list.append(tok) elif tok.type == 'DELIM': if tok.isblock: tok = self._new_node(type = 'TEXT', content = tok.content) self.fixuptkn(tok) list.append(tok) elif tok.content[0] == ":": # FIXME list.append(self.parse_indent(tok)) break else: x = self.parse_inline_delim(tok) if x: list.append(x) else: list.append(self.fixuptkn(self._new_node(type = 'TEXT', content = tok.content))) elif tok.type == 'OTAG': if tok.isblock: self.ungetkn() break list.append(self.parse_tag(tok)) else: list.append(tok) ret = self._new_node(type='SEQ', content=list) self.dprint(80, "LEAVE parse_line=%s", ret) return ret def parse_indent(self, tok): """Parse indented block starting at tok.""" lev = len(tok.content) self.dprint(80, "ENTER parse_indent(%s)", lev) x = self._new_node(type='IND', level=lev, content=self.parse_line()) self.dprint(80, "LEAVE parse_indent=%s", x) return x def parse_fontmod(self, delim, what): """Parse font modification directive (bold or italics). Arguments: delim -- starting delimiter ("''" or "'''") what -- 'IT' or 'BOLD' """ self.dprint(80, "ENTER parse_fontmod(%s,%s), tok %s", delim, what, self.lookahead()) seq = [] text = '' while True: tok = self.getkn() if tok.type == 'TEXT': text += tok.content elif self.is_block_end(tok): self.dprint(80, "LEAVE parse_fontmod=%s", "None") return None elif tok.type == 'DELIM': # self.dprint(80, "got %s, want %s", tok.content, delim) if tok.content == delim: break else: if text: seq.append(self._new_node(type='TEXT', content=text)) text = '' x = self.parse_inline_delim(tok) if x: seq.append(x) else: self.dprint(80, "LEAVE parse_fontmod=%s", "None") return None elif tok.type == 'NL': seq.append(self._new_node(type='TEXT', content='\n')) else: self.dprint(80, "LEAVE parse_fontmod=None") return None if text: seq.append(self._new_node(type='TEXT', content=text)) res = self._new_node(type=what, content=seq) self.dprint(80, "LEAVE parse_fontmod=%s", res) return res def parse_ref(self): """Parse a reference block ([...])""" self.dprint(80, "ENTER parse_ref") tok = self.getkn() if not (tok.type == 'TEXT' and self.refstart.match(tok.content)): self.dprint(80, "LEAVE parse_ref=None") return None seq = [] (ref, sep, text) = tok.content.partition(' ') if text: seq.insert(0, self._new_node(type='TEXT', content=text)) while True: tok = self.getkn() if tok.type == 'NIL': self.dprint(80, "LEAVE parse_ref=None") return None elif self.is_block_end(tok): self.dprint(80, "LEAVE parse_ref=None") return None elif tok.type == 'DELIM': if tok.content == ']': break else: tok = self.parse_inline_delim(tok) if tok: seq.append(tok) else: self.dprint(80, "LEAVE parse_ref=None") return None elif tok.type == 'OTAG': list.append(self.parse_tag(tok)) else: seq.append(tok) ret = self._new_node(type='REF', ref=ref, content=self._new_node(type='SEQ', content=seq)) self.dprint(80, "LEAVE parse_ref= %s", ret) return ret def parse_link(self, type, delim): """Parse an external link ([[...]]). In this implementation, it is also used to parse template references ({{...}}). Arguments: type -- 'LINK' or 'TMPL' delim -- expected closing delimiter. """ self.dprint(80, "ENTER parse_link(%s,%s)", type, delim) subtree = [] list = [] while True: tok = self.getkn() if tok.type == 'NIL': self.dprint(80, "LEAVE parse_link=None [EOF]") return None if tok.type == 'DELIM': if tok.content == delim: if list: subtree.append(self._new_node(type='SEQ', content=list)) break elif tok.content == "|": if len(list) > 1: subtree.append(self._new_node(type='SEQ', content=list)) elif list: subtree.append(list[0]) list = [] else: x = self.parse_inline_delim(tok) if x: list.append(x) else: self.dprint(80, "LEAVE parse_link=None [bad inline]") return None elif tok.type == 'TEXT': list.append(tok) else: self.dprint(80, "LEAVE parse_link=None [unexpected token]") return None ret = self._new_node(type=type, content=subtree) self.dprint(80, "LEAVE parse_link=%s", ret) return ret def parse_inline_delim(self, tok): """Parse an inline block.""" self.dprint(80, "ENTER parse_inline_delim") assert(tok.type == 'DELIM') self.push_mark() if tok.content == "''": x = self.parse_fontmod(tok.content, 'IT') elif tok.content == "'''": x = self.parse_fontmod(tok.content, 'BOLD') elif tok.content == "[": x = self.parse_ref() elif tok.content == "[[": x = self.parse_link('LINK', "]]") elif tok.content == "{{": x = self.parse_link('TMPL', "}}") else: x = None if x: self.clear_mark() else: self.dprint(80, "BEGIN DELIMITER RECOVERY: %s", tok) self.pop_mark() x = self.fixuptkn(self._new_node(type='TEXT', content=tok.content)) od = tok.content if od in self.close_delim: cd = self.close_delim[od] lev = 0 for i, tok in enumerate(self.toklist[self.tokind+1:]): if tok.type == 'NIL': break elif tok.type == 'DELIM': if tok.content == od: lev += 1 elif tok.content == cd: if lev == 0: tok = self._new_node(type='TEXT', content=tok.content) self.toklist[self.tokind+1+i] = tok lev -= 1 break self.dprint(80, "END DELIMITER RECOVERY: %s", tok) self.dprint(80, "LEAVE parse_inline_delim=%s", x) return x def parse_tag(self, tag): """Parse an xml-like tag (such as, e.g. "...").""" self.dprint(80, "ENTER parse_tag") list = [] self.push_mark() while True: tok = self.getkn() if tok.type == 'NIL': self.pop_mark() s = '<' + tag.tag if tag.args: s += ' ' + str(tag.args) s += '>' node = self._new_node(type='TEXT', content=s) if tag.content: self.tree[self.tokind:self.tokind] = tag.content self.dprint(80, "LEAVE parse_tag = %s (tree modified)", node) return node elif tok.type == 'DELIM': if tok.isblock: tok = self.parse_block_delim(tok) else: tok = self.parse_inline_delim(tok) if not tok: tok = self.getkn() elif tok.type == 'CTAG': if tag.tag == tok.tag: break s = '' tok = self.fixuptkn(self._new_node(type='TEXT', content=s)) elif tok.type == 'NL': tok = self._new_node(type = 'TEXT', content = '\n') list.append(tok) self.clear_mark() ret = self._new_node(type = 'TAG', tag = tag.tag, args = tag.args, isblock = tag.isblock, content = self._new_node(type = 'SEQ', content = list)) self.dprint(80, "LEAVE parse_tag = %s", ret) return ret def parse_env(self, tok): """Parse a block environment (numbered, unnumbered, or definition list).""" type = self.envtypes[tok.content[0]][0] lev = len(tok.content) self.dprint(80, "ENTER parse_env(%s,%s)", type, lev) list = [] while True: if (tok.type == 'DELIM' and tok.content[0] in self.envtypes and type == self.envtypes[tok.content[0]][0]): if len(tok.content) < lev: self.ungetkn() break elif len(tok.content) > lev: elt = self.parse_env(tok) else: elt = self.parse_line() if not tok.continuation: list.append(self._new_node(type='ELT', subtype=self.envtypes[tok.content[0]][1], content=elt)) tok = self.getkn() continue if list: if list[-1].content.type != 'SEQ': x = list[-1].content.content # FIXME: list[-1].content = self._new_node(type='SEQ', content=[x]) list[-1].content.content.append(elt) else: self.ungetkn() break tok = self.getkn() ret = self._new_node(type='ENV', envtype=type, level=lev, content=list) self.dprint(80, "LEAVE parse_env=%s", ret) return ret def parse_header(self, tok): """Parse a Wiki header.""" self.dprint(80, "ENTER parse_header") self.push_mark() list = [] delim = tok.content while True: tok = self.getkn() if tok.type == 'NL': self.pop_mark() self.dprint(80, "LEAVE parse_header=None") return None elif tok.type == 'TEXT': list.append(tok) elif tok.type == 'DELIM': if tok.content == delim: if self.lookahead().type == 'NL': self.getkn() if self.lookahead().type == 'NL': self.getkn() break else: self.pop_mark() self.dprint(80, "LEAVE parse_header=None") return None elif tok.isblock: self.pop_mark() self.dprint(80, "LEAVE parse_header=None") return None else: list.append(self.parse_inline_delim(tok)) elif tok.type == 'OTAG': if tok.isblock: self.pop_mark() self.dprint(80, "LEAVE parse_header=None") return None list.append(self.parse_tag(tok)) self.clear_mark() ret = self._new_node(type='HDR', level=len(delim), content=self._new_node(type='SEQ', content=list)) self.dprint(80, "LEAVE parse_header=%s", ret) return ret def parse_block(self): """Parse next block: newline, delimiter, tag, or paragraph.""" tok = self.getkn() while tok.type == 'NL': tok = self.getkn() if tok == None or tok.type == 'NIL': return None elif tok.type == 'DELIM': tok = self.parse_block_delim(tok) if tok: return tok else: tok = self.getkn() elif tok.type == 'OTAG' and tok.isblock: return self.parse_tag(tok) return self.parse_para(tok) def parse(self): """Parse Wiki material supplied by the input() method. Store the resulting abstract parsing tree in the tree attribute. """ if not self.toklist: self.tokenize() if self.debug_level >= 90: print("TOKEN DUMP BEGIN") self.dump(self.toklist) print("TOKEN DUMP END") self.tokind = 0 self.tree = [] while 1: subtree = self.parse_block() if subtree == None: break self.tree.append(subtree) if self.debug_level >= 70: print("TREE DUMP BEGIN") self.dump(self.tree) print("TREE DUMP END") def __str__(self): return str(self.tree) class WikiMarkup(WikiMarkupParser): """ A derived parser class that supplies a basic input method. Three types of inputs are available: 1. filename= The file is opened and used for input. 2. file= The already opened file is used for input. 3. text= Input is taken from , line by line. Usage: obj = WikiMarkup(arg=val) obj.parse ... Do whatever you need with obj.tree ... """ file = None text = None lang = 'en' html_base = 'http://%(lang)s.wikipedia.org/wiki/' image_base = 'http://upload.wikimedia.org/wikipedia/commons/thumb/a/bf' media_base = 'http://www.mediawiki.org/xml/export-0.3' def __init__(self, *args, **keywords): """Create a WikiMarkup object. Arguments: filename=FILE Read Wiki material from the file named FILE. file=FD Read Wiki material from file object FD. text=STRING Read Wiki material from STRING. lang=CODE Specifies source language. Default is 'en'. This variable can be referred to as '%(lang)s' in the keyword arguments below. html_base=URL Base URL for cross-references. Default is 'http://%(lang)s.wikipedia.org/wiki/' image_base=URL Base URL for images. Default is 'http://upload.wikimedia.org/wikipedia/commons/thumb/a/bf' media_base=URL Base URL for media files. Default is 'http://www.mediawiki.org/xml/export-0.3' debug_level=INT debug verbosity level (0 - no debug info, 100 - excessively copious debug messages). Default is 0. strict=BOOL Strict parsing mode. Throw exceptions on syntax errors. Default is False. """ self.token_class = { 'NIL': WikiNode, 'NL': WikiNode, 'OTAG': WikiTagNode, 'CTAG': WikiTagNode, 'TAG': WikiTagNode, 'DELIM': WikiDelimNode, 'TEXT': WikiTextNode, 'PRE': WikiContentNode, 'PARA': WikiSeqNode, 'BAR': WikiNode, 'SEQ': WikiSeqNode, 'IND': WikiIndNode, 'REF': WikiRefNode, 'TMPL': WikiSeqNode, 'IT': WikiSeqNode, 'BOLD': WikiSeqNode, 'ELT': WikiEltNode, 'ENV': WikiEnvNode, 'LINK': WikiSeqNode, 'HDR': WikiHdrNode } for kw in keywords: if kw == 'file': self.file = keywords[kw] elif kw == 'filename': self.file = open(keywords[kw]) elif kw == 'text': if sys.version_info[0] > 2: self.text = keywords[kw].decode('utf-8').split("\n") else: self.text = keywords[kw].split("\n") elif kw == 'lang': self.lang = keywords[kw] elif kw == 'html_base': self.html_base = keywords[kw] elif kw == 'image_base': self.image_base = keywords[kw] elif kw == 'media_base': self.media_base = keywords[kw] elif kw == 'strict': self.strict = keywords[kw] elif kw == 'debug_level': self.debug_level = keywords[kw] def __del__(self): if self.file: self.file.close() def input(self): if self.file: return self.file.readline() elif self.text: return self.text.pop(0) + '\n' else: return None # ISO 639 langtab = { "aa": "Afar", # Afar "ab": "Аҧсуа", # Abkhazian "ae": None, # Avestan "af": "Afrikaans", # Afrikaans "ak": "Akana", # Akan "als": "Alemannisch", "am": "አማርኛ", # Amharic "an": "Aragonés", # Aragonese "ang": "Englisc", "ar": "العربية" , # Arabic "arc": "ܐܪܡܝܐ", "as": "অসমীয়া", # Assamese "ast": "Asturian", "av": "Авар", # Avaric "ay": "Aymara", # Aymara "az": "Azərbaycan" , # Azerbaijani "ba": "Башҡорт", # Bashkir "bar": "Boarisch", "bat-smg": "Žemaitėška", "bcl": "Bikol", "be": "Беларуская", # Byelorussian; Belarusian "be-x-old": "Беларуская (тарашкевіца)", "bg": "Български", # Bulgarian "bh": "भोजपुरी", # Bihari "bi": "Bislama", # Bislama "bm": "Bamanankan", # Bambara "bn": "বাংলা" , # Bengali; Bangla "bo": "བོད་སྐད", # Tibetan "bpy": "ইমার ঠার/বিষ্ণুপ্রিয়া মণিপুরী" , "br": "Brezhoneg" , # Breton "bs": "Bosanski" , # Bosnian "bug": "Basa Ugi", "bxr": "Буряад", "ca": "Català" , # Catalan "cbk-zam": "Chavacano de Zamboanga", "cdo": "Mìng-dĕ̤ng-ngṳ̄", "cho": "Choctaw", "ce": "Нохчийн", # Chechen "ceb": "Sinugboanong Binisaya" , # Cebuano "ch": "Chamor", # Chamorro "chr": "ᏣᎳᎩ", "chy": "Tsetsêhestâhese", "co": "Cors", # Corsican "cr": "Nehiyaw", # Cree "crh": "Qırımtatarca", "cs": "Česky" , # Czech "csb": "Kaszëbsczi", "c": "Словѣньскъ", # Church Slavic "cv": "Чăваш", # Chuvash "cy": "Cymraeg" , # Welsh "da": "Dansk" , # Danish "de": "Deutsch" , # German "diq": "Zazaki", # Dimli (Southern Zazaki) "dsb": "Dolnoserbski", "dv": "ދިވެހިބަސް", # Divehi "dz": "ཇོང་ཁ", # Dzongkha; Bhutani "ee": "Eʋegbe", # Ewe "el": "Ελληνικά" , # Greek "eml": "Emiliàn e rumagnòl", "en": "English" , # English "eo": "Esperanto" , "es": "Español" , # Spanish "et": "Eesti" , # Estonian "eu": "Euskara" , # Basque "ext": "Estremeñ", "fa": "فارسی" , # Persian "ff": "Fulfulde", # Fulah "fi": "Suomi" , # Finnish "fiu-vro": "Võro", "fj": "Na Vosa Vakaviti",# Fijian; Fiji "fo": "Føroyskt" , # Faroese "fr": "Français" , # French "frp": "Arpitan", "fur": "Furlan", "fy": "Frysk", # Frisian "ga": "Gaeilge", # Irish "gan": "贛語 (Gànyŭ)", "gd": "Gàidhlig", # Scots; Gaelic "gl": "Gallego" , # Gallegan; Galician "glk": "گیلکی", "got": "𐌲𐌿𐍄𐌹𐍃𐌺𐍉𐍂𐌰𐌶𐌳𐌰", "gn": "Avañe'ẽ", # Guarani "g": "ગુજરાતી", # Gujarati "gv": "Gaelg", # Manx "ha": "هَوُسَ", # Hausa "hak": "Hak-kâ-fa / 客家話", "haw": "Hawai`i", "he": "עברית" , # Hebrew (formerly iw) "hi": "हिन्दी" , # Hindi "hif": "Fiji Hindi", "ho": "Hiri Mot", # Hiri Motu "hr": "Hrvatski" , # Croatian "hsb": "Hornjoserbsce", "ht": "Krèyol ayisyen" , # Haitian; Haitian Creole "hu": "Magyar" , # Hungarian "hy": "Հայերեն", # Armenian "hz": "Otsiherero", # Herero "ia": "Interlingua", "ie": "Interlingue", "id": "Bahasa Indonesia",# Indonesian (formerly in) "ig": "Igbo", # Igbo "ii": "ꆇꉙ ", # Sichuan Yi "ik": "Iñupiak", # Inupiak "ilo": "Ilokano", "io": "Ido" , "is": "Íslenska" , # Icelandic "it": "Italiano" , # Italian "i": "ᐃᓄᒃᑎᑐᑦ", # Inuktitut "ja": "日本語", # Japanese "jbo": "Lojban", "jv": "Basa Jawa", # Javanese "ka": "ქართული" , # Georgian "kaa": "Qaraqalpaqsha", "kab": "Taqbaylit", "kg": "KiKongo", # Kongo "ki": "Gĩkũyũ", # Kikuyu "kj": "Kuanyama", # Kuanyama "kk": "Қазақша", # Kazakh "kl": "Kalaallisut", # Kalaallisut; Greenlandic "km": "ភាសាខ្មែរ", # Khmer; Cambodian "kn": "ಕನ್ನಡ", # Kannada "ko": "한국어" , # Korean "kr": "Kanuri", # Kanuri "ks": "कश्मीरी / كشميري", # Kashmiri "ksh": "Ripoarisch", "ku": "Kurdî / كوردی", # Kurdish "kv": "Коми", # Komi "kw": "Kernewek/Karnuack", # Cornish "ky": "Кыргызча", # Kirghiz "la": "Latina" , # Latin "lad": "Dzhudezmo", "lb": "Lëtzebuergesch" , # Letzeburgesch "lbe": "Лакку", "lg": "Luganda", # Ganda "li": "Limburgs", # Limburgish; Limburger; Limburgan "lij": "Lígur", "ln": "Lingala", # Lingala "lmo": "Lumbaart", "lo": "ລາວ", # Lao; Laotian "lt": "Lietuvių" , # Lithuanian "lua": "Luba", # Luba "lv": "Latvieš" , # Latvian; Lettish "map-bms": "Basa Banyumasan", "mdf": "Мокшень (Mokshanj Kälj)", "mg": "Malagasy", # Malagasy "mh": "Ebon", # Marshall "mi": "Māori", # Maori "mk": "Македонски" , # Macedonian "ml": None, # Malayalam "mn": "Монгол", # Mongolian "mo": "Молдовеняскэ", # Moldavian "mr": "मराठी" , # Marathi "ms": "Bahasa Melay" , # Malay "mt": "Malti", # Maltese "mus": "Muskogee", "my": "မ္ရန္‌မာစာ", # Burmese "myv": "Эрзянь (Erzjanj Kelj)", "mzn": "مَزِروني", "na": "dorerin Naoero", # Nauru "nah": "Nāhuatl", "nap": "Nnapulitano", "nb": "Norsk (Bokmål)", # Norwegian Bokm@aa{}l "nd": None, # Ndebele, North "nds": "Plattdüütsch", "nds-nl": "Nedersaksisch", "ne": "नेपाली", # Nepali "new": "नेपाल भाषा" , # Nepal Bhasa "ng": "Oshiwambo", # Ndonga "nl": "Nederlands" , # Dutch "nn": "Nynorsk", # Norwegian Nynorsk "no": "Norsk (Bokmål)" , # Norwegian "nov": "Novial", "nr": None, # Ndebele, South "nrm": "Nouormand/Normaund", "nv": "Diné bizaad", # Navajo "ny": "Chi-Chewa", # Chichewa; Nyanja "oc": "Occitan", # Occitan; Proven@,{c}al "oj": None, # Ojibwa "om": "Oromoo", # (Afan) Oromo "or": "ଓଡ଼ିଆ", # Oriya "os": "Иронау", # Ossetian; Ossetic "pa": "ਪੰਜਾਬੀ" , # Panjabi; Punjabi "pag": "Pangasinan", "pam": "Kapampangan", "pap": "Papiament", "pdc": "Deitsch", "pi": "पाऴि", # Pali "pih": "Norfuk", "pl": "Polski" , # Polish "pms": "Piemontèis" , "ps": "پښتو", # Pashto, Pushto "pt": "Português" , # Portuguese "q": "Runa Simi" , # Quechua "rm": "Rumantsch", # Rhaeto-Romance "rmy": "romani - रोमानी", "rn": "Kirundi", # Rundi; Kirundi "ro": "Română" , # Romanian "roa-rup": "Armãneashce", "roa-tara": "Tarandíne", "ru": "Русский" , # Russian "rw": "Ikinyarwanda", # Kinyarwanda "sa": "संस्कृतम्", # Sanskrit "sah": "Саха тыла (Saxa Tyla)", "sc": "Sardu", # Sardinian "scn": "Sicilian", "sco": "Scots", "sd": "سنڌي، سندھی ، सिन्ध", # Sindhi "se": "Sámegiella", # Northern Sami "sg": "Sängö", # Sango; Sangro "sh": "Srpskohrvatski / Српскохрватски" , "si": "සිංහල", "simple": "Simple English" , "sk": "Slovenčina" , # Slovak "sl": "Slovenščina" , # Slovenian "sm": "Gagana Samoa", # Samoan "sn": "chiShona", # Shona "so": "Soomaaliga", # Somali "sr": "Српски / Srpski", # Serbian "srn": "Sranantongo", "ss": "SiSwati", # Swati; Siswati "st": "Sesotho", # Sesotho; Sotho, Southern "stk": "Seeltersk", "s": "Basa Sunda", # Sundanese "sq": "Shqip" , # Albanian "szl": "Ślůnski", "sv": "Svenska" , # Swedish "sw": "Kiswahili", # Swahili "ta": "தமிழ்" , # Tamil "te": "తెలుగు" , # Telugu "tet": "Tetun", "tg": "Тоҷикӣ", # Tajik "th": "ไทย" , # Thai "ti": "ትግርኛ", # Tigrinya "tk": "تركمن / Туркмен", # Turkmen "tl": "Tagalog" , # Tagalog "tn": "Setswana", # Tswana; Setswana "to": "faka Tonga", # Tonga (?) # Also ZW ; MW "tokipona": "Tokipona", "tpi": "Tok Pisin", "tr": "Türkçe" , # Turkish "ts": "Xitsonga", # Tsonga "tt": "Tatarça / Татарча", # Tatar "tum": "chiTumbuka", "tw": "Twi", # Twi "ty": "Reo Mā`ohi", # Tahitian "udm": "Удмурт кыл", "ug": "Oyghurque", # Uighur "uk": "Українська" , # Ukrainian "ur": "اردو", # Urdu "uz": "O‘zbek", # Uzbek "ve": "Tshivenda", # Venda "vec": "Vèneto", "vi": "Tiếng Việt" , # Vietnamese "vls": "West-Vlams", "vo": "Volapük" , "wa": "Walon", # Walloon "war": "Winaray", "wo": "Wolof", # Wolof "w": "吴语", "xal": "Хальмг", "xh": "isiXhosa", # Xhosa "yi": "ייִדיש", # Yiddish "yo": "Yorùbá", # Yoruba "za": "Cuengh", # Zhuang "zea": "Zeêuws", "zh": "中文" , # Chinese "zh-classical": "古文 / 文言文", "zm-min-nan": "Bân-lâm-gú", "zh-yue": "粵語", "zu": "isiZulu" # Zulu } wikitrans-1.3/wikitrans/wiki2text.py0000644000175000017500000002475213340723756017661 0ustar graygray00000000000000#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008-2018 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . """ Wiki markup to plain text translator. Classes: TextWikiMarkup -- Converts Wiki material to plain text. TextWiktionaryMarkup -- Reserved for future use. Currently does the same as TextWikiMarkup. """ from wikitrans.wikitoken import * from wikitrans.wikimarkup import * from wikitrans.wikins import wiki_ns_re, wiki_ns import re try: from urllib import quote as url_quote except ImportError: from urllib.parse import quote as url_quote class TextSeqNode(WikiSeqNode): def format(self): string = "" for x in self.content: if len(string) > 1 and not string[-1].isspace(): string += ' ' string += x.format() return string class TextTextNode(WikiTextNode): def format(self): if isinstance(self.content, list): string = "" for s in self.content: if string: if string.endswith("."): string += " " else: string += " " string += s else: string = self.content return string class TextPreNode(WikiSeqNode): def format(self): string = "" for x in self.content: string += x.format() string += '\n' return string class TextParaNode(WikiSeqNode): def format(self): string = "" for x in self.content: string += x.format() string = self.parser.fmtpara(string) + '\n\n' return string class TextItNode(WikiSeqNode): def format(self): string = "" for x in self.content: s = x.format() if s: string += " " + s return "_" + string.lstrip(" ") + "_" class TextBoldNode(WikiSeqNode): def format(self): string = "" for x in self.content: if string.endswith("."): string += " " else: string += " " string += x.format() return string.upper() class TextLinkNode(WikiSeqNode): def format(self): arg = self.content[0].format() if len(self.content) > 1: s = [x for x in map(lambda x: x.format(), self.content)] text = s[1] else: s = None text = None if s: if s[0] == 'disambigR' or s[0] == 'wikiquote': return "" if len(s) > 1 and s[1] == 'thumb': return "" (qual, sep, tgt) = arg.partition(':') if tgt != '': ns = self.parser.wiki_ns_name(qual) if ns: if ns == 'NS_IMAGE': if not self.parser.show_urls: return "" text = "[%s: %s]" % (qual, text if text else arg) tgt = "%s/%s/250px-%s" % (self.image_base, url_quote(tgt), url_quote(tgt)) elif ns == 'NS_MEDIA': text = "[%s]" % (qual) else: tgt = self.parser.mktgt(tgt) elif self.type == 'LINK' and qual in self.parser.langtab: text = self.parser.langtab[qual] + ": " + tgt tgt = self.parser.mktgt(tgt, qual) else: tgt = self.parser.mktgt(tgt) else: tgt = self.parser.mktgt(arg) if self.parser.show_urls: return "%s (see %s) " % (text, tgt) elif not text or text == '': return arg else: return text class TextTmplNode(TextLinkNode): def format(self): return '[' + super(TextTmplNode, self).format() + ']' class TextBarNode(WikiNode): def format(self): w = self.parser.width if w < 5: w = 5 return "\n" + ("-" * (w - 5)).center(w - 1) + "\n" class TextHdrNode(WikiHdrNode): def format(self): return ("\n" + ("*" * self.level) + " " + self.content.format().lstrip(" ") + "\n\n") class TextRefNode(WikiRefNode): def format(self): text = self.content.format() if text: return "%s (see %s) " % (text, self.ref) else: return "see " + self.ref class TextEnvNode(WikiEnvNode): def format(self): type = self.envtype lev = self.level if lev > self.parser.width - 4: lev = 1 string = "" n = 1 for s in self.content: if not string.endswith("\n"): string += "\n" x = s.content.format() if type == "unnumbered": string += self.parser.indent(lev, "- " + x.lstrip(" ")) elif type == "numbered": string += self.parser.indent(lev, "%d. %s" % (n, x)) n += 1 elif type == "defn": if s.subtype == 0: string += self.parser.indent(lev-1, x) else: string += self.parser.indent(lev+3, x) if not string.endswith("\n"): string += "\n" return string class TextIndNode(WikiIndNode): def format(self): return (" " * self.level) + self.content.format() + '\n' class TextTagNode(WikiTagNode): def format(self): if self.tag == 'code': self.parser.nested += 1 s = self.content.format() self.parser.nested -= 1 elif self.tag == 'ref': s = '[%d]' % (self.idx+1) elif self.tag == 'references': s = '\nReferences:\n' for ref in self.parser.references: s += ('[%d]. ' % (ref.idx+1)) + ref.content.format() + '\n' else: s = '<' + self.tag if self.args: s += ' ' + str(self.args) s += '>' + self.content.format() + '' return s class TextWikiMarkup(WikiMarkup): """A Wiki markup to plain text translator. Usage: x = TextWikiMarkup(file="input.wiki") # Parse the input: x.parse() # Print it as plain text: print(str(x)) """ # Output width width = 78 # Do not show references. show_urls = False # Provide a minimum markup markup = True # Number of current element in the environment num = 0 # Array of footnote references references = [] def __init__(self, *args, **keywords): """Create a TextWikiMarkup object. TextWikiMarkup([filename=FILE],[file=FD],[text=STRING],[lang=CODE], [html_base=URL],[image_base=URL],[media_base=URL], [width=N],[show_urls=False]) Most arguments have the same meaning as in the WikiMarkup constructor. Class-specific arguments: width=N Limit output width to N columns. Default is 78. show_urls=False By default, the link URLs are displayed in parentheses next to the link text. If this argument is given, only the link text will be displayed. """ super(TextWikiMarkup, self).__init__(*args, **keywords) if 'width' in keywords: self.width = keywords['width'] if 'show_urls' in keywords: self.show_urls = keywords['show_urls'] self.token_class['SEQ'] = TextSeqNode self.token_class['TEXT'] = TextTextNode self.token_class['PRE'] = TextPreNode self.token_class['PARA'] = TextParaNode self.token_class['SEQ'] = TextSeqNode self.token_class['IT'] = TextItNode self.token_class['BOLD'] = TextBoldNode self.token_class['LINK'] = TextLinkNode self.token_class['TMPL'] = TextTmplNode self.token_class['BAR'] = TextBarNode self.token_class['HDR'] = TextHdrNode self.token_class['REF'] = TextRefNode self.token_class['ENV'] = TextEnvNode self.token_class['IND'] = TextIndNode self.token_class['TAG'] = TextTagNode def wiki_ns_name(self, str): if str in wiki_ns[self.lang]: return wiki_ns[self.lang][str] elif str in wiki_ns_re[self.lang]: for elt in wiki_ns_re[self.lang][str]: if str.beginswith(elt[0]) and str.endswith(elt[1]): return elt[2] return None def mktgt(self, tgt, lang = None): if not lang: lang = self.lang return self.html_base % { 'lang' : lang } + url_quote(tgt) def indent(self, lev, text): if text.find('\n') == -1: s = (" " * lev) + text else: s = "" for elt in text.split('\n'): if elt: s += (" " * lev) + elt + '\n' if not text.endswith('\n'): s = s.rstrip('\n') return s def fmtpara(self, input): output = "" linebuf = "" length = 0 for s in input.split(): wlen = len(s) if len(linebuf) == 0: wsc = 0 elif linebuf.endswith("."): wsc = 2 else: wsc = 1 if length + wsc + wlen > self.width: # FIXME: fill out linebuf output += linebuf + '\n' wsc = 0 length = 0 linebuf = "" linebuf += " " * wsc + s length += wsc + wlen return output + linebuf def __str__(self): str = "" for elt in self.tree: str += elt.format() return str class TextWiktionaryMarkup(TextWikiMarkup): """A class for translating Wiktionary articles into plain text. Reserved for future use. Currently does the same as TextWikiMarkup. """ html_base='http://%(lang)s.wiktionary.org/wiki/' wikitrans-1.3/wikitrans/wiki2texi.py0000644000175000017500000003100413340032704017614 0ustar graygray00000000000000#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2015-2018 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . """ Wiki markup to Texinfo translator. Classes: TexiWikiMarkup -- Converts Wiki material to Texinfo. """ from wikitrans.wikimarkup import * from wikitrans.wikitoken import * from wikitrans.wikins import wiki_ns_re, wiki_ns import re import urllib class Acc(list): def prepend(self, x): self.insert(0, x) def is_empty(self): return len(self) == 0 def clear(self): self = [] def tail(self, n = 1): s = Acc() i = len(self) while i > 0 and n > 0: elt = self[i-1] l = len(elt) if l == 0: continue elif l > n: l = n s.prepend(elt[-n:]) n -= l i -= 1 return str(s) def trim(self, n): while len(self) and n > 0: elt = self.pop() l = len(elt) if l == 0: continue elif l > n: self += elt[0:-n] break n -= l def trimnl(self): if self.endswith('\n'): self.trim(1) def trimpara(self): if self.endswith('\n\n'): self.trim(2) def endswith(self, x): return self.tail(len(x)) == x def in_new_para(self): return self.is_empty() or self.endswith('\n\n') def __str__(self): return ''.join(self) class TexiTextNode(WikiTextNode): def format(self): parser = self.parser if isinstance(self.content, list): for s in self.content: parser._print(s) else: parser._print(self.content) class TexiTagNode(WikiTagNode): def format(self): parser = self.parser if self.tag in ['code', 'tt']: save = parser._begin_print() parser.nested += 1 self.content.format() parser.nested -= 1 s = parser._end_print(save) if self.isblock: parser._print('@example', nl=True, escape=False) parser._print(s, escape=False) parser._print('@end example\n', nl=True, escape=False) else: parser._print('@code{%s}' % s, escape=False) elif self.tag == 'div': if self.args and 'id' in self.args: parser._print("@anchor{%s}\n" % self.args['id'], nl=True, escape=False) self.content.format() elif self.tag == 'ref': parser._print('@footnote{', escape=False); self.content.format(); parser._print('}', escape=False) elif self.tag == 'references': pass else: parser._print('<' + self.tag) if self.args: parser._print(' ' + self.args) parser._print('>'); self.content.format() parser._print('') class TexiParaNode(WikiSeqNode): def format(self): parser = self.parser if not parser.acc.in_new_para(): parser._print('\n', nl=True) for x in self.content: x.format() if not parser.acc.in_new_para(): parser._print('\n', nl=True) class TexiPreNode(WikiSeqNode): def format(self): parser = self.parser if not parser.nested: parser._print('@example\n', nl=True, escape=False) for x in self.content: x.format() if not parser.nested: parser._print('@end example\n', nl=True, escape=False) class TexiFontNode(WikiSeqNode): def format(self): parser = self.parser comm = { 'IT': 'i', 'BOLD': 'b' } parser._print('@%s{' % comm[self.type], escape=False) for x in self.content: x.format() parser._print('}', escape=False) class TexiHdrNode(WikiHdrNode): def format(self): parser = self.parser level = self.level # FIXME if level > len(parser.sectcomm[parser.sectioning_model]) - 1 - parser.sectioning_start: parser._print("@* ", nl=True, escape=False) self.content.format() else: parser._print(parser.sectcomm[parser.sectioning_model][level - parser.sectioning_start] + " ", nl=True, escape=False) self.content.format() parser._print(None, nl=True) if parser.sectcomm[parser.sectioning_model][0] == '@top': parser._print('@node ', nl=True, escape=False) self.content.format() parser._print('\n') parser._print(None, nl=True) class TexiBarNode(WikiNode): def format(self): self.parser._print("\n-----\n") class TexiIndNode(WikiIndNode): def format(self): parser = self.parser parser._print("@w{ }" * self.level, nl=True, escape=False) self.content.format() parser._print(None, nl=True) class TexiEnvNode(WikiEnvNode): def format(self): parser = self.parser if self.envtype == 'unnumbered': parser._print('@itemize @bullet\n', nl=True, escape=False) for s in self.content: parser._print('@item ', nl=True, escape=False) s.content.format() parser._print(None, nl=True) parser._print('\n') parser._print('@end itemize\n', nl=True, escape=False) elif self.envtype == 'numbered': parser._print('@enumerate\n', nl=True, escape=False) for s in self.content: parser._print('@item ', nl=True, escape=False) s.content.format() parser._print(None, nl=True) parser._print('\n') parser._print('@end enumerate\n', nl=True, escape=False) elif self.envtype == 'defn': parser._print('@table @asis\n', nl=True, escape=False) for s in self.content: if s.subtype == 0: parser._print('@item ', nl=True, escape=False) s.content.format() parser._print(None, nl=True) else: s.content.format() parser._print(None, nl=True) parser._print('\n') parser._print('@end table\n', nl=True, escape=False) class TexiLinkNode(WikiSeqNode): def format(self): parser = self.parser save = parser._begin_print() self.content[0].format() arg = parser._end_print() if len(self.content) > 1: s = [] for x in self.content[0:2]: parser._begin_print() x.format() s.append(parser._end_print()) text = s[1] else: s = None text = None parser._end_print(save) if s: if s[0] == 'disambigR' or s[0] == 'wikiquote': return if len(s) > 1 and s[1] == 'thumb': return (qual, sep, tgt) = arg.partition(':') if text: parser._print("@ref{%s,%s}" % (qual, text), escape=False) else: parser._print("@ref{%s}" % qual, escape=False) class TexiRefNode(WikiRefNode): def format(self): parser = self.parser target = self.ref save = parser._begin_print() self.content.format() text = parser._end_print(save) if text and text != '': parser._print("@uref{%s,%s}" % (target, text), escape=False) else: parser._print("@uref{%s}" % target, escape=False) class TexiWikiMarkup(WikiMarkup): """Wiki markup to Texinfo translator class. Usage: x = TexiWikiMarkup(file="input.wiki") # Parse the input: x.parse() # Print it as Texi: print(str(x)) """ nested = 0 sectcomm = { 'numbered': [ '@top', '@chapter', '@section', '@subsection', '@subsubsection' ], 'unnumbered': [ '@top', '@unnumbered', '@unnumberedsec', '@unnumberedsubsec', '@unnumberedsubsubsec' ], 'appendix': [ '@top', '@appendix', '@appendixsec', '@appendixsubsec', '@appendixsubsubsec' ], 'heading': [ '@majorheading' '@chapheading', '@heading', '@subheading', '@subsubheading' ] } sectioning_model = 'numbered' sectioning_start = 0 def __init__(self, *args, **keywords): """Create a TexiWikiMarkup object. TexiWikiMarkup([filename=FILE],[file=FD],[text=STRING],[lang=CODE], [html_base=URL],[image_base=URL],[media_base=URL], [sectioning_model=MODEL],[sectioning_start=N]) For a discussion of generic arguments, see the constructor of the WikiMarkup class. Additional arguments: sectioning_model=MODEL Select the Texinfo sectioning model for the output document. Possible values are: 'numbered' Top of document is marked with "@top". Headings ("=", "==", "===", etc) produce "@chapter", "@section", "@subsection", etc. 'unnumbered' Unnumbered sectioning: "@top", "@unnumbered", "@unnumberedsec", "@unnumberedsubsec". 'appendix' Sectioning suitable for appendix entries: "@top", "@appendix", "@appendixsec", "@appendixsubsec", etc. 'heading' Use heading directives to reflect sectioning: "@majorheading", "@chapheading", "@heading", "@subheading", etc. sectioning_start=N Shift resulting heading level by N positions. For example, supposing "sectioning_model='numbered'", "== A ==" normally produces "@section A" on output. Now, if given "sectioning_start=1", this directive will produce "@subsection A" instead. """ super(TexiWikiMarkup, self).__init__(*args, **keywords) self.token_class['TEXT'] = TexiTextNode self.token_class['TAG'] = TexiTagNode self.token_class['PARA'] = TexiParaNode self.token_class['PRE'] = TexiPreNode self.token_class['IT'] = TexiFontNode self.token_class['BOLD'] = TexiFontNode self.token_class['HDR'] = TexiHdrNode self.token_class['BAR'] = TexiBarNode self.token_class['IND'] = TexiIndNode self.token_class['ENV'] = TexiEnvNode self.token_class['LINK'] = TexiLinkNode self.token_class['REF'] = TexiRefNode if "sectioning_model" in keywords: val = keywords["sectioning_model"] if val in self.sectcomm: self.sectioning_model = val else: raise ValueError("Invalid value for sectioning model: %s" % val) if "sectioning_start" in keywords: val = keywords["sectioning_start"] if val < 0 or val > 4: raise ValueError("Invalid value for sectioning start: %s" % val) else: self.sectioning_start = val replchars = re.compile(r'([@{}])') acc = Acc() def _print(self, text, **kw): nl = kw.pop('nl', False) escape = kw.pop('escape', True) if nl and not self.acc.endswith('\n'): self.acc += '\n' if text: if escape: self.acc += self.replchars.sub(r'@\1', text) else: self.acc += text def _begin_print(self): s = self.acc self.acc = Acc() return s def _end_print(self, val = None): s = self.acc self.acc = val return str(s) def __str__(self): self._begin_print() for elt in self.tree: elt.format() self.acc.trimpara() return self._end_print() wikitrans-1.3/wikitrans/wikins.py0000644000175000017500000030063713340032704017214 0ustar graygray00000000000000# This file is generated automatically. Do not edit. # -*- coding: utf-8 -*- wiki_ns_io = { "Media": "NS_MEDIA", "Specala": "NS_SPECIAL", "Debato": "NS_TALK", "Uzanto": "NS_USER", "Uzanto_Debato": "NS_USER_TALK", "Imajo": "NS_IMAGE", "Imajo_Debato": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_Debato": "NS_MEDIAWIKI_TALK", "Shablono": "NS_TEMPLATE", "Shablono_Debato": "NS_TEMPLATE_TALK", "Helpo": "NS_HELP", "Helpo_Debato": "NS_HELP_TALK", "Kategorio": "NS_CATEGORY", "Kategorio_Debato": "NS_CATEGORY_TALK", } wiki_ns_re_io = [ ("", "_Debato", "NS_PROJECT_TALK"), ] wiki_ns_et = { "Meedia": "NS_MEDIA", "Eri": "NS_SPECIAL", "Arutelu": "NS_TALK", "Kasutaja": "NS_USER", "Kasutaja_arutelu": "NS_USER_TALK", "Pilt": "NS_IMAGE", "Pildi_arutelu": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_arutelu": "NS_MEDIAWIKI_TALK", "Mall": "NS_TEMPLATE", "Malli_arutelu": "NS_TEMPLATE_TALK", "Juhend": "NS_HELP", "Juhendi_arutelu": "NS_HELP_TALK", "Kategooria": "NS_CATEGORY", "Kategooria_arutelu": "NS_CATEGORY_TALK", } wiki_ns_re_et = [ ("", "_arutelu", "NS_PROJECT_TALK"), ] wiki_ns_is = { "Miðill": "NS_MEDIA", "Kerfissíða": "NS_SPECIAL", "Spjall": "NS_TALK", "Notandi": "NS_USER", "Notandaspjall": "NS_USER_TALK", "Mynd": "NS_IMAGE", "Myndaspjall": "NS_IMAGE_TALK", "Melding": "NS_MEDIAWIKI", "Meldingarspjall": "NS_MEDIAWIKI_TALK", "Snið": "NS_TEMPLATE", "Sniðaspjall": "NS_TEMPLATE_TALK", "Hjálp": "NS_HELP", "Hjálparspjall": "NS_HELP_TALK", "Flokkur": "NS_CATEGORY", "Flokkaspjall": "NS_CATEGORY_TALK", } wiki_ns_re_is = [ ("", "spjall", "NS_PROJECT_TALK"), ] wiki_ns_mr = { "मिडिया": "NS_MEDIA", "विशेष": "NS_SPECIAL", "चर्चा": "NS_TALK", "सदस्य": "NS_USER", "सदस्य_चर्चा": "NS_USER_TALK", "चित्र": "NS_IMAGE", "चित्र_चर्चा": "NS_IMAGE_TALK", "मिडियाविकी": "NS_MEDIAWIKI", "मिडियाविकी_चर्चा": "NS_MEDIAWIKI_TALK", "साचा": "NS_TEMPLATE", "साचा_चर्चा": "NS_TEMPLATE_TALK", "साहाय्य": "NS_HELP", "साहाय्य_चर्चा": "NS_HELP_TALK", "वर्ग": "NS_CATEGORY", "वर्ग_चर्चा": "NS_CATEGORY_TALK", } wiki_ns_re_mr = [ ("", "_चर्चा", "NS_PROJECT_TALK"), ] wiki_ns_tyv = { "Медиа": "NS_MEDIA", "Тускай": "NS_SPECIAL", "Чугаа": "NS_TALK", "Aжыглакчы": "NS_USER", "Aжыглакчы_чугаа": "NS_USER_TALK", "Чурук": "NS_IMAGE", "Чурук_чугаа": "NS_IMAGE_TALK", "МедиаВики": "NS_MEDIAWIKI", "МедиаВики_чугаа": "NS_MEDIAWIKI_TALK", "Хээ": "NS_TEMPLATE", "Хээ_чугаа": "NS_TEMPLATE_TALK", "Дуза": "NS_HELP", "Дуза_чугаа": "NS_HELP_TALK", "Бөлүк": "NS_CATEGORY", "Бөлүк_чугаа": "NS_CATEGORY_TALK", } wiki_ns_re_tyv = [ ("", "_чугаа", "NS_PROJECT_TALK"), ] wiki_ns_qu = { "Midya": "NS_MEDIA", "Sapaq": "NS_SPECIAL", "Rimanakuy": "NS_TALK", "Ruraq": "NS_USER", "Ruraq_rimanakuy": "NS_USER_TALK", "Rikcha": "NS_IMAGE", "Rikcha_rimanakuy": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_rimanakuy": "NS_MEDIAWIKI_TALK", "Plantilla": "NS_TEMPLATE", "Plantilla_rimanakuy": "NS_TEMPLATE_TALK", "Yanapa": "NS_HELP", "Yanapa_rimanakuy": "NS_HELP_TALK", "Katiguriya": "NS_CATEGORY", "Katiguriya_rimanakuy": "NS_CATEGORY_TALK", } wiki_ns_re_qu = [ ("", "_rimanakuy", "NS_PROJECT_TALK"), ] wiki_ns_frp = { "Mèdia": "NS_MEDIA", "Spèciâl": "NS_SPECIAL", "Discutar": "NS_TALK", "Utilisator": "NS_USER", "Discussion_Utilisator": "NS_USER_TALK", "Émâge": "NS_IMAGE", "Discussion_Émâge": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Discussion_MediaWiki": "NS_MEDIAWIKI_TALK", "Modèlo": "NS_TEMPLATE", "Discussion_Modèlo": "NS_TEMPLATE_TALK", "Éde": "NS_HELP", "Discussion_Éde": "NS_HELP_TALK", "Catègorie": "NS_CATEGORY", "Discussion_Catègorie": "NS_CATEGORY_TALK", } wiki_ns_re_frp = [ ("Discussion_", "", "NS_PROJECT_TALK"), ] wiki_ns_kab = { "Media": "NS_MEDIA", "Uslig": "NS_SPECIAL", "Mmeslay": "NS_TALK", "Amseqdac": "NS_USER", "Amyannan_umsqedac": "NS_USER_TALK", "Tugna": "NS_IMAGE", "Amyannan_n_tugna": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Amyannan_n_MediaWiki": "NS_MEDIAWIKI_TALK", "Talɣa": "NS_TEMPLATE", "Amyannan_n_talɣa": "NS_TEMPLATE_TALK", "Tallat": "NS_HELP", "Amyannan_n_tallat": "NS_HELP_TALK", "Taggayt": "NS_CATEGORY", "Amyannan_n_taggayt": "NS_CATEGORY_TALK", } wiki_ns_re_kab = [ ("Amyannan_n_", "", "NS_PROJECT_TALK"), ] wiki_ns_fo = { "Miðil": "NS_MEDIA", "Serstakur": "NS_SPECIAL", "Kjak": "NS_TALK", "Brúkari": "NS_USER", "Brúkari_kjak": "NS_USER_TALK", "Mynd": "NS_IMAGE", "Mynd_kjak": "NS_IMAGE_TALK", "MidiaWiki": "NS_MEDIAWIKI", "MidiaWiki_kjak": "NS_MEDIAWIKI_TALK", "Fyrimynd": "NS_TEMPLATE", "Fyrimynd_kjak": "NS_TEMPLATE_TALK", "Hjálp": "NS_HELP", "Hjálp kjak": "NS_HELP_TALK", "Bólkur": "NS_CATEGORY", "Bólkur_kjak": "NS_CATEGORY_TALK", } wiki_ns_re_fo = [ ("", "_kjak", "NS_PROJECT_TALK"), ] wiki_ns_pt_br = { "Media": "NS_MEDIA", "Especial": "NS_SPECIAL", "Discussão": "NS_TALK", "Usuário": "NS_USER", "Usuário_Discussão": "NS_USER_TALK", "Imagem": "NS_IMAGE", "Imagem_Discussão": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_Discussão": "NS_MEDIAWIKI_TALK", "Predefinição": "NS_TEMPLATE", "Predefinição_Discussão": "NS_TEMPLATE_TALK", "Ajuda": "NS_HELP", "Ajuda_Discussão": "NS_HELP_TALK", "Categoria": "NS_CATEGORY", "Categoria_Discussão": "NS_CATEGORY_TALK", } wiki_ns_re_pt_br = [ ("", "_Discussão", "NS_PROJECT_TALK"), ] wiki_ns_dsb = { "Medija": "NS_MEDIA", "Specialne": "NS_SPECIAL", "Diskusija": "NS_TALK", "Wužywaŕ": "NS_USER", "Diskusija_wužywarja": "NS_USER_TALK", "Wobraz": "NS_IMAGE", "Diskusija_wó_wobrazu": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_diskusija": "NS_MEDIAWIKI_TALK", "Pśedłoga": "NS_TEMPLATE", "Diskusija_wó_pśedłoze": "NS_TEMPLATE_TALK", "Pomoc": "NS_HELP", "Diskusija_wó_pomocy": "NS_HELP_TALK", "Kategorija": "NS_CATEGORY", "Diskusija_wó_kategoriji": "NS_CATEGORY_TALK", } wiki_ns_re_dsb = [ ("", "_diskusija", "NS_PROJECT_TALK"), ] wiki_ns_jv = { "Media": "NS_MEDIA", "Astamiwa": "NS_SPECIAL", "Dhiskusi": "NS_TALK", "Panganggo": "NS_USER", "Dhiskusi_Panganggo": "NS_USER_TALK", "Gambar": "NS_IMAGE", "Dhiskusi_Gambar": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Dhiskusi_MediaWiki": "NS_MEDIAWIKI_TALK", "Cithakan": "NS_TEMPLATE", "Dhiskusi_Cithakan": "NS_TEMPLATE_TALK", "Pitulung": "NS_HELP", "Dhiskusi_Pitulung": "NS_HELP_TALK", "Kategori": "NS_CATEGORY", "Dhiskusi_Kategori": "NS_CATEGORY_TALK", } wiki_ns_re_jv = [ ("Dhiskusi_", "", "NS_PROJECT_TALK"), ] wiki_ns_vo = { "Nünamakanäd": "NS_MEDIA", "Patikos": "NS_SPECIAL", "Bespik": "NS_TALK", "Geban": "NS_USER", "Gebanibespik": "NS_USER_TALK", "Magod": "NS_IMAGE", "Magodibespik": "NS_IMAGE_TALK", "Sitanuns": "NS_MEDIAWIKI", "Bespik_dö_sitanuns": "NS_MEDIAWIKI_TALK", "Samafomot": "NS_TEMPLATE", "Samafomotibespik": "NS_TEMPLATE_TALK", "Yuf": "NS_HELP", "Yufibespik": "NS_HELP_TALK", "Klad": "NS_CATEGORY", "Kladibespik": "NS_CATEGORY_TALK", } wiki_ns_re_vo = [ ("Bespik_dö_", "", "NS_PROJECT_TALK"), ] wiki_ns_ka = { "მედია": "NS_MEDIA", "სპეციალური": "NS_SPECIAL", "განხილვა": "NS_TALK", "მომხმარებელი": "NS_USER", "მომხმარებელი_განხილვა": "NS_USER_TALK", "სურათი": "NS_IMAGE", "სურათი_განხილვა": "NS_IMAGE_TALK", "მედიავიკი": "NS_MEDIAWIKI", "მედიავიკი_განხილვა": "NS_MEDIAWIKI_TALK", "თარგი": "NS_TEMPLATE", "თარგი_განხილვა": "NS_TEMPLATE_TALK", "დახმარება": "NS_HELP", "დახმარება_განხილვა": "NS_HELP_TALK", "კატეგორია": "NS_CATEGORY", "კატეგორია_განხილვა": "NS_CATEGORY_TALK", } wiki_ns_re_ka = [ ("", "_განხილვა", "NS_PROJECT_TALK"), ] wiki_ns_gn = { "Mba'echĩchĩ": "NS_SPECIAL", "Myangekõi": "NS_TALK", "Puruhára": "NS_USER", "Puruhára_myangekõi": "NS_USER_TALK", "Ta'ãnga": "NS_IMAGE", "Ta'ãnga_myangekõi": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_myangekõi": "NS_MEDIAWIKI_TALK", "Tembiecharã": "NS_TEMPLATE", "Tembiecharã_myangekõi": "NS_TEMPLATE_TALK", "Pytyvõ": "NS_HELP", "Pytyvõ_myangekõi": "NS_HELP_TALK", "Ñemohenda": "NS_CATEGORY", "Ñemohenda_myangekõi": "NS_CATEGORY_TALK", } wiki_ns_re_gn = [ ("", "_myangekõi", "NS_PROJECT_TALK"), ] wiki_ns_sr_el = { "Medija": "NS_MEDIA", "Posebno": "NS_SPECIAL", "Razgovor": "NS_TALK", "Korisnik": "NS_USER", "Razgovor_sa_korisnikom": "NS_USER_TALK", "Slika": "NS_IMAGE", "Razgovor_o_slici": "NS_IMAGE_TALK", "MedijaViki": "NS_MEDIAWIKI", "Razgovor_o_MedijaVikiju": "NS_MEDIAWIKI_TALK", "Šablon": "NS_TEMPLATE", "Razgovor_o_šablonu": "NS_TEMPLATE_TALK", "Pomoć": "NS_HELP", "Razgovor_o_pomoći": "NS_HELP_TALK", "Kategorija": "NS_CATEGORY", "Razgovor_o_kategoriji": "NS_CATEGORY_TALK", } wiki_ns_re_sr_el = [ ("Razgovor_o_", "", "NS_PROJECT_TALK"), ] wiki_ns_cs = { "Média": "NS_MEDIA", "Speciální": "NS_SPECIAL", "Diskuse": "NS_TALK", "Uživatel": "NS_USER", "Uživatel_diskuse": "NS_USER_TALK", "Soubor": "NS_IMAGE", "Soubor_diskuse": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_diskuse": "NS_MEDIAWIKI_TALK", "Šablona": "NS_TEMPLATE", "Šablona_diskuse": "NS_TEMPLATE_TALK", "Nápověda": "NS_HELP", "Nápověda_diskuse": "NS_HELP_TALK", "Kategorie": "NS_CATEGORY", "Kategorie_diskuse": "NS_CATEGORY_TALK", } wiki_ns_re_cs = [ ("", "_diskuse", "NS_PROJECT_TALK"), ] wiki_ns_sc = { "Speciale": "NS_SPECIAL", "Contièndha": "NS_TALK", "Utente": "NS_USER", "Utente_discussioni": "NS_USER_TALK", "Immàgini": "NS_IMAGE", "Immàgini_contièndha": "NS_IMAGE_TALK", } wiki_ns_re_sc = [ ("", "_discussioni", "NS_PROJECT_TALK"), ] wiki_ns_km = { "មេឌា": "NS_MEDIA", "ពិសេស": "NS_SPECIAL", "ការពិភាក្សា": "NS_TALK", "អ្នកប្រើប្រាស់": "NS_USER", "ការពិភាក្សារបស់អ្នកប្រើប្រាស់": "NS_USER_TALK", "រូបភាព": "NS_IMAGE", "ការពិភាក្សាអំពីរូបភាព": "NS_IMAGE_TALK", "មេឌាវិគី": "NS_MEDIAWIKI", "ការពិភាក្សាអំពីមេឌាវិគី": "NS_MEDIAWIKI_TALK", "ទំព័រគំរូ": "NS_TEMPLATE", "ការពិភាក្សាអំពីទំព័រគំរូ": "NS_TEMPLATE_TALK", "ជំនួយ": "NS_HELP", "ការពិភាក្សាអំពីជំនួយ": "NS_HELP_TALK", "ចំណាត់ថ្នាក់ក្រុម": "NS_CATEGORY", "ការពិភាក្សាអំពីចំណាត់ថ្នាក់ក្រុម": "NS_CATEGORY_TALK", } wiki_ns_re_km = [ ("ការពិភាក្សាអំពី", "", "NS_PROJECT_TALK"), ] wiki_ns_sk = { "Médiá": "NS_MEDIA", "Špeciálne": "NS_SPECIAL", "Diskusia": "NS_TALK", "Redaktor": "NS_USER", "Diskusia_s_redaktorom": "NS_USER_TALK", "Obrázok": "NS_IMAGE", "Diskusia_k_obrázku": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Diskusia_k_MediaWiki": "NS_MEDIAWIKI_TALK", "Šablóna": "NS_TEMPLATE", "Diskusia_k_šablóne": "NS_TEMPLATE_TALK", "Pomoc": "NS_HELP", "Diskusia_k_pomoci": "NS_HELP_TALK", "Kategória": "NS_CATEGORY", "Diskusia_ku_kategórii": "NS_CATEGORY_TALK", } wiki_ns_re_sk = [ ("Diskusia_k_{{grammar:datív|", "}}", "NS_PROJECT_TALK"), ] wiki_ns_bpy = { "মিডিয়া": "NS_MEDIA", "বিশেষ": "NS_SPECIAL", "য়্যারী": "NS_TALK", "আতাকুরা": "NS_USER", "আতাকুরার_য়্যারী": "NS_USER_TALK", "ছবি": "NS_IMAGE", "ছবি_য়্যারী": "NS_IMAGE_TALK", "মিডিয়াউইকি": "NS_MEDIAWIKI", "মিডিয়াউইকির_য়্যারী": "NS_MEDIAWIKI_TALK", "মডেল": "NS_TEMPLATE", "মডেলর_য়্যারী": "NS_TEMPLATE_TALK", "পাংলাক": "NS_HELP", "পাংলাকর_য়্যারী": "NS_HELP_TALK", "থাক": "NS_CATEGORY", "থাকর_য়্যারী": "NS_CATEGORY_TALK", } wiki_ns_re_bpy = [ ("", "_য়্যারী", "NS_PROJECT_TALK"), ] wiki_ns_he = { "מדיה": "NS_MEDIA", "מיוחד": "NS_SPECIAL", "שיחה": "NS_TALK", "משתמש": "NS_USER", "שיחת_משתמש": "NS_USER_TALK", "תמונה": "NS_IMAGE", "שיחת_תמונה": "NS_IMAGE_TALK", "מדיה_ויקי": "NS_MEDIAWIKI", "שיחת_מדיה_ויקי": "NS_MEDIAWIKI_TALK", "תבנית": "NS_TEMPLATE", "שיחת_תבנית": "NS_TEMPLATE_TALK", "עזרה": "NS_HELP", "שיחת_עזרה": "NS_HELP_TALK", "קטגוריה": "NS_CATEGORY", "שיחת_קטגוריה": "NS_CATEGORY_TALK", } wiki_ns_re_he = [ ("שיחת_", "", "NS_PROJECT_TALK"), ] wiki_ns_hi = { "Media": "NS_MEDIA", "विशेष": "NS_SPECIAL", "वार्ता": "NS_TALK", "सदस्य": "NS_USER", "सदस्य_वार्ता": "NS_USER_TALK", "चित्र": "NS_IMAGE", "चित्र_वार्ता": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_talk": "NS_MEDIAWIKI_TALK", "साँचा": "NS_TEMPLATE", "साँचा_वार्ता": "NS_TEMPLATE_TALK", "श्रेणी": "NS_CATEGORY", "श्रेणी_वार्ता": "NS_CATEGORY_TALK", } wiki_ns_re_hi = [ ("", "_वार्ता", "NS_PROJECT_TALK"), ] wiki_ns_hu = { "Média": "NS_MEDIA", "Speciális": "NS_SPECIAL", "Vita": "NS_TALK", "Szerkesztő": "NS_USER", "Szerkesztővita": "NS_USER_TALK", "Kép": "NS_IMAGE", "Képvita": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki-vita": "NS_MEDIAWIKI_TALK", "Sablon": "NS_TEMPLATE", "Sablonvita": "NS_TEMPLATE_TALK", "Segítség": "NS_HELP", "Segítségvita": "NS_HELP_TALK", "Kategória": "NS_CATEGORY", "Kategóriavita": "NS_CATEGORY_TALK", } wiki_ns_re_hu = [ ("", "-vita", "NS_PROJECT_TALK"), ] wiki_ns_lt = { "Medija": "NS_MEDIA", "Specialus": "NS_SPECIAL", "Aptarimas": "NS_TALK", "Naudotojas": "NS_USER", "Naudotojo_aptarimas": "NS_USER_TALK", "Vaizdas": "NS_IMAGE", "Vaizdo_aptarimas": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_aptarimas": "NS_MEDIAWIKI_TALK", "Šablonas": "NS_TEMPLATE", "Šablono_aptarimas": "NS_TEMPLATE_TALK", "Pagalba": "NS_HELP", "Pagalbos_aptarimas": "NS_HELP_TALK", "Kategorija": "NS_CATEGORY", "Kategorijos_aptarimas": "NS_CATEGORY_TALK", } wiki_ns_re_lt = [ ("", "_aptarimas", "NS_PROJECT_TALK"), ] wiki_ns_hy = { "Մեդիա": "NS_MEDIA", "Սպասարկող": "NS_SPECIAL", "Քննարկում": "NS_TALK", "Մասնակից": "NS_USER", "Մասնակցի_քննարկում": "NS_USER_TALK", "Պատկեր": "NS_IMAGE", "Պատկերի_քննարկում": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_քննարկում": "NS_MEDIAWIKI_TALK", "Կաղապար": "NS_TEMPLATE", "Կաղապարի_քննարկում": "NS_TEMPLATE_TALK", "Օգնություն": "NS_HELP", "Օգնության_քննարկում": "NS_HELP_TALK", "Կատեգորիա": "NS_CATEGORY", "Կատեգորիայի_քննարկում": "NS_CATEGORY_TALK", } wiki_ns_re_hy = [ ("{{GRAMMAR:genitive|", "}}_քննարկում", "NS_PROJECT_TALK"), ] wiki_ns_ps = { "رسنۍ": "NS_MEDIA", "ځانګړی": "NS_SPECIAL", "خبرې_اترې": "NS_TALK", "کارونکی": "NS_USER", "د_کارونکي_خبرې_اترې": "NS_USER_TALK", "انځور": "NS_IMAGE", "د_انځور_خبرې_اترې": "NS_IMAGE_TALK", "ميډياويکي": "NS_MEDIAWIKI", "د_ميډياويکي_خبرې_اترې": "NS_MEDIAWIKI_TALK", "کينډۍ": "NS_TEMPLATE", "د_کينډۍ_خبرې_اترې": "NS_TEMPLATE_TALK", "لارښود": "NS_HELP", "د_لارښود_خبرې_اترې": "NS_HELP_TALK", "وېشنيزه": "NS_CATEGORY", "د_وېشنيزې_خبرې_اترې": "NS_CATEGORY_TALK", } wiki_ns_re_ps = [ ("د_", "_خبرې_اترې", "NS_PROJECT_TALK"), ] wiki_ns_ksh = { "Medie": "NS_MEDIA", "Spezial": "NS_SPECIAL", "Klaaf": "NS_TALK", "Metmaacher": "NS_USER", "Metmaacher_Klaaf": "NS_USER_TALK", "Beld": "NS_IMAGE", "Belder_Klaaf": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_Klaaf": "NS_MEDIAWIKI_TALK", "Schablon": "NS_TEMPLATE", "Schablone_Klaaf": "NS_TEMPLATE_TALK", "Hölp": "NS_HELP", "Hölp_Klaaf": "NS_HELP_TALK", "Saachjrupp": "NS_CATEGORY", "Saachjrupp_Klaaf": "NS_CATEGORY_TALK", } wiki_ns_re_ksh = [ ("", "_Klaaf", "NS_PROJECT_TALK"), ] wiki_ns_tr = { "Media": "NS_MEDIA", "Özel": "NS_SPECIAL", "Tartışma": "NS_TALK", "Kullanıcı": "NS_USER", "Kullanıcı_mesaj": "NS_USER_TALK", "Resim": "NS_IMAGE", "Resim_tartışma": "NS_IMAGE_TALK", "MedyaViki": "NS_MEDIAWIKI", "MedyaViki_tartışma": "NS_MEDIAWIKI_TALK", "Şablon": "NS_TEMPLATE", "Şablon_tartışma": "NS_TEMPLATE_TALK", "Yardım": "NS_HELP", "Yardım_tartışma": "NS_HELP_TALK", "Kategori": "NS_CATEGORY", "Kategori_tartışma": "NS_CATEGORY_TALK", } wiki_ns_re_tr = [ ("", "_tartışma", "NS_PROJECT_TALK"), ] wiki_ns_af = { "Media": "NS_MEDIA", "Spesiaal": "NS_SPECIAL", "Bespreking": "NS_TALK", "Gebruiker": "NS_USER", "Gebruikerbespreking": "NS_USER_TALK", "Beeld": "NS_IMAGE", "Beeldbespreking": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWikibespreking": "NS_MEDIAWIKI_TALK", "Sjabloon": "NS_TEMPLATE", "Sjabloonbespreking": "NS_TEMPLATE_TALK", "Hulp": "NS_HELP", "Hulpbespreking": "NS_HELP_TALK", "Kategorie": "NS_CATEGORY", "Kategoriebespreking": "NS_CATEGORY_TALK", } wiki_ns_re_af = [ ("", "bespreking", "NS_PROJECT_TALK"), ] wiki_ns_zh_hans = { "Media": "NS_MEDIA", "Special": "NS_SPECIAL", "Talk": "NS_TALK", "User": "NS_USER", "User_talk": "NS_USER_TALK", "Image": "NS_IMAGE", "Image_talk": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_talk": "NS_MEDIAWIKI_TALK", "Template": "NS_TEMPLATE", "Template_talk": "NS_TEMPLATE_TALK", "Help": "NS_HELP", "Help_talk": "NS_HELP_TALK", "Category": "NS_CATEGORY", "Category_talk": "NS_CATEGORY_TALK", } wiki_ns_re_zh_hans = [ ("", "_talk", "NS_PROJECT_TALK"), ] wiki_ns_id = { "Media": "NS_MEDIA", "Istimewa": "NS_SPECIAL", "Pembicaraan": "NS_TALK", "Pengguna": "NS_USER", "Pembicaraan_Pengguna": "NS_USER_TALK", "Berkas": "NS_IMAGE", "Pembicaraan_Berkas": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Pembicaraan_MediaWiki": "NS_MEDIAWIKI_TALK", "Templat": "NS_TEMPLATE", "Pembicaraan_Templat": "NS_TEMPLATE_TALK", "Bantuan": "NS_HELP", "Pembicaraan_Bantuan": "NS_HELP_TALK", "Kategori": "NS_CATEGORY", "Pembicaraan_Kategori": "NS_CATEGORY_TALK", } wiki_ns_re_id = [ ("Pembicaraan_", "", "NS_PROJECT_TALK"), ] wiki_ns_tet = { "Media": "NS_MEDIA", "Espesiál": "NS_SPECIAL", "Diskusaun": "NS_TALK", "Uza-na'in": "NS_USER", "Diskusaun_Uza-na'in": "NS_USER_TALK", "Imajen": "NS_IMAGE", "Diskusaun_Imajen": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Diskusaun_MediaWiki": "NS_MEDIAWIKI_TALK", "Template": "NS_TEMPLATE", "Diskusaun_Template": "NS_TEMPLATE_TALK", "Ajuda": "NS_HELP", "Diskusaun_Ajuda": "NS_HELP_TALK", "Kategoria": "NS_CATEGORY", "Diskusaun_Kategoria": "NS_CATEGORY_TALK", } wiki_ns_re_tet = [ ("Diskusaun_", "", "NS_PROJECT_TALK"), ] wiki_ns_an = { "Media": "NS_MEDIA", "Espezial": "NS_SPECIAL", "Descusión": "NS_TALK", "Usuario": "NS_USER", "Descusión_usuario": "NS_USER_TALK", "Imachen": "NS_IMAGE", "Descusión_imachen": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Descusión_MediaWiki": "NS_MEDIAWIKI_TALK", "Plantilla": "NS_TEMPLATE", "Descusión_plantilla": "NS_TEMPLATE_TALK", "Aduya": "NS_HELP", "Descusión_aduya": "NS_HELP_TALK", "Categoría": "NS_CATEGORY", "Descusión_categoría": "NS_CATEGORY_TALK", } wiki_ns_re_an = [ ("Descusión_", "", "NS_PROJECT_TALK"), ] wiki_ns_ar = { "ميديا": "NS_MEDIA", "خاص": "NS_SPECIAL", "نقاش": "NS_TALK", "مستخدم": "NS_USER", "نقاش_المستخدم": "NS_USER_TALK", "صورة": "NS_IMAGE", "نقاش_الصورة": "NS_IMAGE_TALK", "ميدياويكي": "NS_MEDIAWIKI", "نقاش_ميدياويكي": "NS_MEDIAWIKI_TALK", "قالب": "NS_TEMPLATE", "نقاش_القالب": "NS_TEMPLATE_TALK", "مساعدة": "NS_HELP", "نقاش_المساعدة": "NS_HELP_TALK", "تصنيف": "NS_CATEGORY", "نقاش_التصنيف": "NS_CATEGORY_TALK", } wiki_ns_re_ar = [ ("نقاش_", "", "NS_PROJECT_TALK"), ] wiki_ns_tg_cyrl = { "Медиа": "NS_MEDIA", "Вижа": "NS_SPECIAL", "Баҳс": "NS_TALK", "Корбар": "NS_USER", "Баҳси_корбар": "NS_USER_TALK", "Акс": "NS_IMAGE", "Баҳси_акс": "NS_IMAGE_TALK", "Медиавики": "NS_MEDIAWIKI", "Баҳси_медиавики": "NS_MEDIAWIKI_TALK", "Шаблон": "NS_TEMPLATE", "Баҳси_шаблон": "NS_TEMPLATE_TALK", "Роҳнамо": "NS_HELP", "Баҳси_роҳнамо": "NS_HELP_TALK", "Гурӯҳ": "NS_CATEGORY", "Баҳси_гурӯҳ": "NS_CATEGORY_TALK", } wiki_ns_re_tg_cyrl = [ ("Баҳси_", "", "NS_PROJECT_TALK"), ] wiki_ns_rmy = { "Mediya": "NS_MEDIA", "Uzalutno": "NS_SPECIAL", "Vakyarimata": "NS_TALK", "Jeno": "NS_USER", "Jeno_vakyarimata": "NS_USER_TALK", "Chitro": "NS_IMAGE", "Chitro_vakyarimata": "NS_IMAGE_TALK", "MediyaViki": "NS_MEDIAWIKI", "MediyaViki_vakyarimata": "NS_MEDIAWIKI_TALK", "Sikavno": "NS_TEMPLATE", "Sikavno_vakyarimata": "NS_TEMPLATE_TALK", "Zhutipen": "NS_HELP", "Zhutipen_vakyarimata": "NS_HELP_TALK", "Shopni": "NS_CATEGORY", "Shopni_vakyarimata": "NS_CATEGORY_TALK", } wiki_ns_re_rmy = [ ("{{grammar:genitive-pl|", "}}_vakyarimata", "NS_PROJECT_TALK"), ] wiki_ns_mk = { "Медија": "NS_MEDIA", "Специјални": "NS_SPECIAL", "Разговор": "NS_TALK", "Корисник": "NS_USER", "Разговор_со_корисник": "NS_USER_TALK", "Слика": "NS_IMAGE", "Разговор_за_слика": "NS_IMAGE_TALK", "МедијаВики": "NS_MEDIAWIKI", "Разговор_за_МедијаВики": "NS_MEDIAWIKI_TALK", "Шаблон": "NS_TEMPLATE", "Разговор_за_шаблон": "NS_TEMPLATE_TALK", "Помош": "NS_HELP", "Разговор_за_помош": "NS_HELP_TALK", "Категорија": "NS_CATEGORY", "Разговор_за_категорија": "NS_CATEGORY_TALK", } wiki_ns_re_mk = [ ("Разговор_за_", "", "NS_PROJECT_TALK"), ] wiki_ns_eu = { "Media": "NS_MEDIA", "Aparteko": "NS_SPECIAL", "Eztabaida": "NS_TALK", "Lankide": "NS_USER", "Lankide_eztabaida": "NS_USER_TALK", "Irudi": "NS_IMAGE", "Irudi_eztabaida": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_eztabaida": "NS_MEDIAWIKI_TALK", "Txantiloi": "NS_TEMPLATE", "Txantiloi_eztabaida": "NS_TEMPLATE_TALK", "Laguntza": "NS_HELP", "Laguntza_eztabaida": "NS_HELP_TALK", "Kategoria": "NS_CATEGORY", "Kategoria_eztabaida": "NS_CATEGORY_TALK", } wiki_ns_re_eu = [ ("", "_eztabaida", "NS_PROJECT_TALK"), ] wiki_ns_az = { "Mediya": "NS_MEDIA", "Xüsusi": "NS_SPECIAL", "Müzakirə": "NS_TALK", "İstifadəçi": "NS_USER", "İstifadəçi_müzakirəsi": "NS_USER_TALK", "Şəkil": "NS_IMAGE", "Şəkil_müzakirəsi": "NS_IMAGE_TALK", "MediyaViki": "NS_MEDIAWIKI", "MediyaViki_müzakirəsi": "NS_MEDIAWIKI_TALK", "Şablon": "NS_TEMPLATE", "Şablon_müzakirəsi": "NS_TEMPLATE_TALK", "Kömək": "NS_HELP", "Kömək_müzakirəsi": "NS_HELP_TALK", "Kateqoriya": "NS_CATEGORY", "Kateqoriya_müzakirəsi": "NS_CATEGORY_TALK", } wiki_ns_re_az = [ ("", "_müzakirəsi", "NS_PROJECT_TALK"), ] wiki_ns_bat_smg = { "Specēlos": "NS_SPECIAL", "Aptarėms": "NS_TALK", "Nauduotuos": "NS_USER", "Nauduotuojė_aptarėms": "NS_USER_TALK", "Abruozdielis": "NS_IMAGE", "Abruozdielė_aptarėms": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_aptarėms": "NS_MEDIAWIKI_TALK", "Šabluons": "NS_TEMPLATE", "Šabluona_aptarėms": "NS_TEMPLATE_TALK", "Pagelba": "NS_HELP", "Pagelbas_aptarėms": "NS_HELP_TALK", "Kateguorėjė": "NS_CATEGORY", "Kateguorėjės_aptarėms": "NS_CATEGORY_TALK", } wiki_ns_re_bat_smg = [ ("", "_aptarėms", "NS_PROJECT_TALK"), ] wiki_ns_it = { "Media": "NS_MEDIA", "Speciale": "NS_SPECIAL", "Discussione": "NS_TALK", "Utente": "NS_USER", "Discussioni_utente": "NS_USER_TALK", "Immagine": "NS_IMAGE", "Discussioni_immagine": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Discussioni_MediaWiki": "NS_MEDIAWIKI_TALK", "Template": "NS_TEMPLATE", "Discussioni_template": "NS_TEMPLATE_TALK", "Aiuto": "NS_HELP", "Discussioni_aiuto": "NS_HELP_TALK", "Categoria": "NS_CATEGORY", "Discussioni_categoria": "NS_CATEGORY_TALK", } wiki_ns_re_it = [ ("Discussioni_", "", "NS_PROJECT_TALK"), ] wiki_ns_ms = { "Media": "NS_MEDIA", "Khas": "NS_SPECIAL", "Perbincangan": "NS_TALK", "Pengguna": "NS_USER", "Perbincangan_Pengguna": "NS_USER_TALK", "Imej": "NS_IMAGE", "Perbincangan_Imej": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Perbincangan_MediaWiki": "NS_MEDIAWIKI_TALK", "Templat": "NS_TEMPLATE", "Perbincangan_Templat": "NS_TEMPLATE_TALK", "Bantuan": "NS_HELP", "Perbincangan_Bantuan": "NS_HELP_TALK", "Kategori": "NS_CATEGORY", "Perbincangan_Kategori": "NS_CATEGORY_TALK", } wiki_ns_re_ms = [ ("Perbincangan_", "", "NS_PROJECT_TALK"), ] wiki_ns_ba = { "Медиа": "NS_MEDIA", "Ярҙамсы": "NS_SPECIAL", "Фекер_алышыу": "NS_TALK", "Ҡатнашыусы": "NS_USER", "Ҡатнашыусы_м-н_фекер_алышыу": "NS_USER_TALK", "Рәсем": "NS_IMAGE", "Рәсем_б-са_фекер_алышыу": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_б-са_фекер_алышыу": "NS_MEDIAWIKI_TALK", "Ҡалып": "NS_TEMPLATE", "Ҡалып_б-са_фекер_алышыу": "NS_TEMPLATE_TALK", "Белешмә": "NS_HELP", "Белешмә_б-са_фекер_алышыу": "NS_HELP_TALK", "Категория": "NS_CATEGORY", "Категория_б-са_фекер_алышыу": "NS_CATEGORY_TALK", } wiki_ns_re_ba = [ ("", "_б-са_фекер_алышыу", "NS_PROJECT_TALK"), ] wiki_ns_be = { "Мультымедыя": "NS_MEDIA", "Адмысловае": "NS_SPECIAL", "Размовы": "NS_TALK", "Удзельнік": "NS_USER", "Размовы_з_удзельнікам": "NS_USER_TALK", "Выява": "NS_IMAGE", "Размовы_пра_выяву": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Размовы_пра_MediaWiki": "NS_MEDIAWIKI_TALK", "Шаблон": "NS_TEMPLATE", "Размовы_пра_шаблон": "NS_TEMPLATE_TALK", "Даведка": "NS_HELP", "Размовы_пра_даведку": "NS_HELP_TALK", "Катэгорыя": "NS_CATEGORY", "Размовы_пра_катэгорыю": "NS_CATEGORY_TALK", } wiki_ns_re_be = [ ("", "_размовы", "NS_PROJECT_TALK"), ] wiki_ns_crh_cyrl = { "Медиа": "NS_MEDIA", "Махсус": "NS_SPECIAL", "Музакере": "NS_TALK", "Къулланыджы": "NS_USER", "Къулланыджы_музакереси": "NS_USER_TALK", "Ресим": "NS_IMAGE", "Ресим_музакереси": "NS_IMAGE_TALK", "МедиаВики": "NS_MEDIAWIKI", "МедиаВики_музакереси": "NS_MEDIAWIKI_TALK", "Шаблон": "NS_TEMPLATE", "Шаблон_музакереси": "NS_TEMPLATE_TALK", "Ярдым": "NS_HELP", "Ярдым_музакереси": "NS_HELP_TALK", "Категория": "NS_CATEGORY", "Категория_музакереси": "NS_CATEGORY_TALK", } wiki_ns_re_crh_cyrl = [ ("", "_музакереси", "NS_PROJECT_TALK"), ] wiki_ns_nn = { "Filpeikar": "NS_MEDIA", "Spesial": "NS_SPECIAL", "Diskusjon": "NS_TALK", "Brukar": "NS_USER", "Brukardiskusjon": "NS_USER_TALK", "Fil": "NS_IMAGE", "Fildiskusjon": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki-diskusjon": "NS_MEDIAWIKI_TALK", "Mal": "NS_TEMPLATE", "Maldiskusjon": "NS_TEMPLATE_TALK", "Hjelp": "NS_HELP", "Hjelpdiskusjon": "NS_HELP_TALK", "Kategori": "NS_CATEGORY", "Kategoridiskusjon": "NS_CATEGORY_TALK", } wiki_ns_re_nn = [ ("", "-diskusjon", "NS_PROJECT_TALK"), ] wiki_ns_nv = { "Media": "NS_MEDIA", "Special": "NS_SPECIAL", "Naaltsoos_baa_yinísht'į́": "NS_TALK", "Choinish'įįhí": "NS_USER", "Choinish'įįhí_baa_yinísht'į́": "NS_USER_TALK", "E'elyaaígíí": "NS_IMAGE", "E'elyaaígíí_baa_yinísht'į́": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_baa_yinísht'į́": "NS_MEDIAWIKI_TALK", "Template": "NS_TEMPLATE", "Template_talk": "NS_TEMPLATE_TALK", "Aná'álwo'": "NS_HELP", "Aná'álwo'_baa_yinísht'į́": "NS_HELP_TALK", "T'ááłáhági_át'éego": "NS_CATEGORY", "T'ááłáhági_át'éego_baa_yinísht'į́": "NS_CATEGORY_TALK", } wiki_ns_re_nv = [ ("", "_baa_yinísht'į́", "NS_PROJECT_TALK"), ] wiki_ns_ru = { "Медиа": "NS_MEDIA", "Служебная": "NS_SPECIAL", "Обсуждение": "NS_TALK", "Участник": "NS_USER", "Обсуждение_участника": "NS_USER_TALK", "Изображение": "NS_IMAGE", "Обсуждение_изображения": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Обсуждение_MediaWiki": "NS_MEDIAWIKI_TALK", "Шаблон": "NS_TEMPLATE", "Обсуждение_шаблона": "NS_TEMPLATE_TALK", "Справка": "NS_HELP", "Обсуждение_справки": "NS_HELP_TALK", "Категория": "NS_CATEGORY", "Обсуждение_категории": "NS_CATEGORY_TALK", } wiki_ns_re_ru = [ ("Обсуждение_{{grammar:genitive|", "}}", "NS_PROJECT_TALK"), ] wiki_ns_crh_latn = { "Media": "NS_MEDIA", "Mahsus": "NS_SPECIAL", "Muzakere": "NS_TALK", "Qullanıcı": "NS_USER", "Qullanıcı_muzakeresi": "NS_USER_TALK", "Resim": "NS_IMAGE", "Resim_muzakeresi": "NS_IMAGE_TALK", "MediaViki": "NS_MEDIAWIKI", "MediaViki_muzakeresi": "NS_MEDIAWIKI_TALK", "Şablon": "NS_TEMPLATE", "Şablon_muzakeresi": "NS_TEMPLATE_TALK", "Yardım": "NS_HELP", "Yardım_muzakeresi": "NS_HELP_TALK", "Kategoriya": "NS_CATEGORY", "Kategoriya_muzakeresi": "NS_CATEGORY_TALK", } wiki_ns_re_crh_latn = [ ("", "_muzakeresi", "NS_PROJECT_TALK"), ] wiki_ns_be_tarask = { "Мэдыя": "NS_MEDIA", "Спэцыяльныя": "NS_SPECIAL", "Абмеркаваньне": "NS_TALK", "Удзельнік": "NS_USER", "Гутаркі_ўдзельніка": "NS_USER_TALK", "Выява": "NS_IMAGE", "Абмеркаваньне_выявы": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Абмеркаваньне_MediaWiki": "NS_MEDIAWIKI_TALK", "Шаблён": "NS_TEMPLATE", "Абмеркаваньне_шаблёну": "NS_TEMPLATE_TALK", "Дапамога": "NS_HELP", "Абмеркаваньне_дапамогі": "NS_HELP_TALK", "Катэгорыя": "NS_CATEGORY", "Абмеркаваньне_катэгорыі": "NS_CATEGORY_TALK", } wiki_ns_re_be_tarask = [ ("Абмеркаваньне_", "", "NS_PROJECT_TALK"), ] wiki_ns_yue = { "Media": "NS_MEDIA", "Special": "NS_SPECIAL", "Talk": "NS_TALK", "User": "NS_USER", "User_talk": "NS_USER_TALK", "Image": "NS_IMAGE", "Image_talk": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_talk": "NS_MEDIAWIKI_TALK", "Template": "NS_TEMPLATE", "Template_talk": "NS_TEMPLATE_TALK", "Help": "NS_HELP", "Help_talk": "NS_HELP_TALK", "Category": "NS_CATEGORY", "Category_talk": "NS_CATEGORY_TALK", } wiki_ns_re_yue = [ ("", "_talk", "NS_PROJECT_TALK"), ] wiki_ns_kn = { "ಮೀಡಿಯ": "NS_MEDIA", "ವಿಶೇಷ": "NS_SPECIAL", "ಚರ್ಚೆಪುಟ": "NS_TALK", "ಸದಸ್ಯ": "NS_USER", "ಸದಸ್ಯರ_ಚರ್ಚೆಪುಟ": "NS_USER_TALK", "ಚಿತ್ರ": "NS_IMAGE", "ಚಿತ್ರ_ಚರ್ಚೆಪುಟ": "NS_IMAGE_TALK", "ಮೀಡಿಯವಿಕಿ": "NS_MEDIAWIKI", "ಮೀಡೀಯವಿಕಿ_ಚರ್ಚೆ": "NS_MEDIAWIKI_TALK", "ಟೆಂಪ್ಲೇಟು": "NS_TEMPLATE", "ಟೆಂಪ್ಲೇಟು_ಚರ್ಚೆ": "NS_TEMPLATE_TALK", "ಸಹಾಯ": "NS_HELP", "ಸಹಾಯ_ಚರ್ಚೆ": "NS_HELP_TALK", "ವರ್ಗ": "NS_CATEGORY", "ವರ್ಗ_ಚರ್ಚೆ": "NS_CATEGORY_TALK", } wiki_ns_re_kn = [ ("", "_ಚರ್ಚೆ", "NS_PROJECT_TALK"), ] wiki_ns_sl = { "Media": "NS_MEDIA", "Posebno": "NS_SPECIAL", "Pogovor": "NS_TALK", "Uporabnik": "NS_USER", "Uporabniški_pogovor": "NS_USER_TALK", "Slika": "NS_IMAGE", "Pogovor_o_sliki": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Pogovor_o_MediaWiki": "NS_MEDIAWIKI_TALK", "Predloga": "NS_TEMPLATE", "Pogovor_o_predlogi": "NS_TEMPLATE_TALK", "Pomoč": "NS_HELP", "Pogovor_o_pomoči": "NS_HELP_TALK", "Kategorija": "NS_CATEGORY", "Pogovor_o_kategoriji": "NS_CATEGORY_TALK", } wiki_ns_re_sl = [ ("Pogovor_{{grammar:mestnik|", "}}", "NS_PROJECT_TALK"), ] wiki_ns_nds = { "Media": "NS_MEDIA", "Spezial": "NS_SPECIAL", "Diskuschoon": "NS_TALK", "Bruker": "NS_USER", "Bruker_Diskuschoon": "NS_USER_TALK", "Bild": "NS_IMAGE", "Bild_Diskuschoon": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_Diskuschoon": "NS_MEDIAWIKI_TALK", "Vörlaag": "NS_TEMPLATE", "Vörlaag_Diskuschoon": "NS_TEMPLATE_TALK", "Hülp": "NS_HELP", "Hülp_Diskuschoon": "NS_HELP_TALK", "Kategorie": "NS_CATEGORY", "Kategorie_Diskuschoon": "NS_CATEGORY_TALK", } wiki_ns_re_nds = [ ("", "_Diskuschoon", "NS_PROJECT_TALK"), ] wiki_ns_tlh = { "Doch": "NS_MEDIA", "le'": "NS_SPECIAL", "ja'chuq": "NS_TALK", "lo'wI'": "NS_USER", "lo'wI'_ja'chuq": "NS_USER_TALK", "nagh_beQ": "NS_IMAGE", "nagh_beQ_ja'chuq": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_ja'chuq": "NS_MEDIAWIKI_TALK", "chen'ay'": "NS_TEMPLATE", "chen'ay'_ja'chuq": "NS_TEMPLATE_TALK", "QaH": "NS_HELP", "QaH_ja'chuq": "NS_HELP_TALK", "Segh": "NS_CATEGORY", "Segh_ja'chuq": "NS_CATEGORY_TALK", } wiki_ns_re_tlh = [ ("", "_ja'chuq", "NS_PROJECT_TALK"), ] wiki_ns_la = { "Specialis": "NS_SPECIAL", "Disputatio": "NS_TALK", "Usor": "NS_USER", "Disputatio_Usoris": "NS_USER_TALK", "Imago": "NS_IMAGE", "Disputatio_Imaginis": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Disputatio_MediaWiki": "NS_MEDIAWIKI_TALK", "Formula": "NS_TEMPLATE", "Disputatio_Formulae": "NS_TEMPLATE_TALK", "Auxilium": "NS_HELP", "Disputatio_Auxilii": "NS_HELP_TALK", "Categoria": "NS_CATEGORY", "Disputatio_Categoriae": "NS_CATEGORY_TALK", } wiki_ns_re_la = [ ("Disputatio_{{grammar:genitive|", "}}", "NS_PROJECT_TALK"), ] wiki_ns_li = { "Media": "NS_MEDIA", "Speciaal": "NS_SPECIAL", "Euverlèk": "NS_TALK", "Gebroeker": "NS_USER", "Euverlèk_gebroeker": "NS_USER_TALK", "Plaetje": "NS_IMAGE", "Euverlèk_plaetje": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Euverlèk_MediaWiki": "NS_MEDIAWIKI_TALK", "Sjabloon": "NS_TEMPLATE", "Euverlèk_sjabloon": "NS_TEMPLATE_TALK", "Help": "NS_HELP", "Euverlèk_help": "NS_HELP_TALK", "Categorie": "NS_CATEGORY", "Euverlèk_categorie": "NS_CATEGORY_TALK", } wiki_ns_re_li = [ ("Euverlèk_", "", "NS_PROJECT_TALK"), ] wiki_ns_hr = { "Mediji": "NS_MEDIA", "Posebno": "NS_SPECIAL", "Razgovor": "NS_TALK", "Suradnik": "NS_USER", "Razgovor_sa_suradnikom": "NS_USER_TALK", "Slika": "NS_IMAGE", "Razgovor_o_slici": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_razgovor": "NS_MEDIAWIKI_TALK", "Predložak": "NS_TEMPLATE", "Razgovor_o_predlošku": "NS_TEMPLATE_TALK", "Pomoć": "NS_HELP", "Razgovor_o_pomoći": "NS_HELP_TALK", "Kategorija": "NS_CATEGORY", "Razgovor_o_kategoriji": "NS_CATEGORY_TALK", } wiki_ns_re_hr = [ ("Razgovor_", "", "NS_PROJECT_TALK"), ] wiki_ns_pl = { "Media": "NS_MEDIA", "Specjalna": "NS_SPECIAL", "Dyskusja": "NS_TALK", "Użytkownik": "NS_USER", "Dyskusja_użytkownika": "NS_USER_TALK", "Grafika": "NS_IMAGE", "Dyskusja_grafiki": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Dyskusja_MediaWiki": "NS_MEDIAWIKI_TALK", "Szablon": "NS_TEMPLATE", "Dyskusja_szablonu": "NS_TEMPLATE_TALK", "Pomoc": "NS_HELP", "Dyskusja_pomocy": "NS_HELP_TALK", "Kategoria": "NS_CATEGORY", "Dyskusja_kategorii": "NS_CATEGORY_TALK", } wiki_ns_re_pl = [ ("Dyskusja_", "", "NS_PROJECT_TALK"), ] wiki_ns_nds_nl = { "Media": "NS_MEDIA", "Speciaal": "NS_SPECIAL", "Overleg": "NS_TALK", "Gebruker": "NS_USER", "Overleg_gebruker": "NS_USER_TALK", "Ofbeelding": "NS_IMAGE", "Overleg_ofbeelding": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Overleg_MediaWiki": "NS_MEDIAWIKI_TALK", "Sjabloon": "NS_TEMPLATE", "Overleg_sjabloon": "NS_TEMPLATE_TALK", "Hulpe": "NS_HELP", "Overleg_hulpe": "NS_HELP_TALK", "Kattegerie": "NS_CATEGORY", "Overleg_kattegerie": "NS_CATEGORY_TALK", } wiki_ns_re_nds_nl = [ ("Overleg_", "", "NS_PROJECT_TALK"), ] wiki_ns_pt = { "Media": "NS_MEDIA", "Especial": "NS_SPECIAL", "Discussão": "NS_TALK", "Usuário": "NS_USER", "Usuário_Discussão": "NS_USER_TALK", "Imagem": "NS_IMAGE", "Imagem_Discussão": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_Discussão": "NS_MEDIAWIKI_TALK", "Predefinição": "NS_TEMPLATE", "Predefinição_Discussão": "NS_TEMPLATE_TALK", "Ajuda": "NS_HELP", "Ajuda_Discussão": "NS_HELP_TALK", "Categoria": "NS_CATEGORY", "Categoria_Discussão": "NS_CATEGORY_TALK", } wiki_ns_re_pt = [ ("", "_Discussão", "NS_PROJECT_TALK"), ] wiki_ns_xal = { "Аһар": "NS_MEDIA", "Көдлхнə": "NS_SPECIAL", "Ухалвр": "NS_TALK", "Орлцач": "NS_USER", "Орлцачна_тускар_ухалвр": "NS_USER_TALK", "Зург": "NS_IMAGE", "Зургин_тускар_ухалвр": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_тускар_ухалвр": "NS_MEDIAWIKI_TALK", "Зура": "NS_TEMPLATE", "Зуран_тускар_ухалвр": "NS_TEMPLATE_TALK", "Цəəлһлһн": "NS_HELP", "Цəəлһлһин_тускар_ухалвр": "NS_HELP_TALK", "Янз": "NS_CATEGORY", "Янзин_тускар_ухалвр": "NS_CATEGORY_TALK", } wiki_ns_re_xal = [ ("", "_тускар_ухалвр", "NS_PROJECT_TALK"), ] wiki_ns_ast = { "Media": "NS_MEDIA", "Especial": "NS_SPECIAL", "Alderique": "NS_TALK", "Usuariu": "NS_USER", "Usuariu_alderique": "NS_USER_TALK", "Imaxe": "NS_IMAGE", "Imaxe_alderique": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_alderique": "NS_MEDIAWIKI_TALK", "Plantía": "NS_TEMPLATE", "Plantía_alderique": "NS_TEMPLATE_TALK", "Aida": "NS_HELP", "Aida_alderique": "NS_HELP_TALK", "Categoría": "NS_CATEGORY", "Categoría_alderique": "NS_CATEGORY_TALK", } wiki_ns_re_ast = [ ("", "_alderique", "NS_PROJECT_TALK"), ] wiki_ns_ia = { "Media": "NS_MEDIA", "Special": "NS_SPECIAL", "Discussion": "NS_TALK", "Usator": "NS_USER", "Discussion_Usator": "NS_USER_TALK", "Imagine": "NS_IMAGE", "Discussion_Imagine": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Discussion_MediaWiki": "NS_MEDIAWIKI_TALK", "Patrono": "NS_TEMPLATE", "Discussion_Patrono": "NS_TEMPLATE_TALK", "Adjuta": "NS_HELP", "Discussion_Adjuta": "NS_HELP_TALK", "Categoria": "NS_CATEGORY", "Discussion_Categoria": "NS_CATEGORY_TALK", } wiki_ns_re_ia = [ ("Discussion_", "", "NS_PROJECT_TALK"), ] wiki_ns_kk_arab = { "تاسپا": "NS_MEDIA", "ارنايى": "NS_SPECIAL", "تالقىلاۋ": "NS_TALK", "قاتىسۋشى": "NS_USER", "قاتىسۋشى_تالقىلاۋى": "NS_USER_TALK", "سۋرەت": "NS_IMAGE", "سۋرەت_تالقىلاۋى": "NS_IMAGE_TALK", "مەدىياۋىيكىي": "NS_MEDIAWIKI", "مەدىياۋىيكىي_تالقىلاۋى": "NS_MEDIAWIKI_TALK", "ۇلگى": "NS_TEMPLATE", "ۇلگى_تالقىلاۋى": "NS_TEMPLATE_TALK", "انىقتاما": "NS_HELP", "انىقتاما_تالقىلاۋى": "NS_HELP_TALK", "سانات": "NS_CATEGORY", "سانات_تالقىلاۋى": "NS_CATEGORY_TALK", } wiki_ns_re_kk_arab = [ ("", "_تالقىلاۋى", "NS_PROJECT_TALK"), ] wiki_ns_zh_hant = { "Media": "NS_MEDIA", "Special": "NS_SPECIAL", "Talk": "NS_TALK", "User": "NS_USER", "User_talk": "NS_USER_TALK", "Image": "NS_IMAGE", "Image_talk": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_talk": "NS_MEDIAWIKI_TALK", "Template": "NS_TEMPLATE", "Template_talk": "NS_TEMPLATE_TALK", "Help": "NS_HELP", "Help_talk": "NS_HELP_TALK", "Category": "NS_CATEGORY", "Category_talk": "NS_CATEGORY_TALK", } wiki_ns_re_zh_hant = [ ("", "_talk", "NS_PROJECT_TALK"), ] wiki_ns_fur = { "Media": "NS_MEDIA", "Speciâl": "NS_SPECIAL", "Discussion": "NS_TALK", "Utent": "NS_USER", "Discussion_utent": "NS_USER_TALK", "Figure": "NS_IMAGE", "Discussion_figure": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Discussion_MediaWiki": "NS_MEDIAWIKI_TALK", "Model": "NS_TEMPLATE", "Discussion_model": "NS_TEMPLATE_TALK", "Jutori": "NS_HELP", "Discussion_jutori": "NS_HELP_TALK", "Categorie": "NS_CATEGORY", "Discussion_categorie": "NS_CATEGORY_TALK", } wiki_ns_re_fur = [ ("Discussion_", "", "NS_PROJECT_TALK"), ] wiki_ns_en = { "Media": "NS_MEDIA", "Special": "NS_SPECIAL", "Talk": "NS_TALK", "User": "NS_USER", "User_talk": "NS_USER_TALK", "Image": "NS_IMAGE", "Image_talk": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_talk": "NS_MEDIAWIKI_TALK", "Template": "NS_TEMPLATE", "Template_talk": "NS_TEMPLATE_TALK", "Help": "NS_HELP", "Help_talk": "NS_HELP_TALK", "Category": "NS_CATEGORY", "Category_talk": "NS_CATEGORY_TALK", } wiki_ns_re_en = [ ("", "_talk", "NS_PROJECT_TALK"), ] wiki_ns_lbe = { "Медиа": "NS_MEDIA", "Къуллугъирал_лажин": "NS_SPECIAL", "Ихтилат": "NS_TALK", "Гьуртту_хьума": "NS_USER", "Гьуртту_хьуминнал_ихтилат": "NS_USER_TALK", "Сурат": "NS_IMAGE", "Суратраясса_ихтилат": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWikiлиясса_ихтилат": "NS_MEDIAWIKI_TALK", "Шаблон": "NS_TEMPLATE", "Шаблондалиясса_ихтилат": "NS_TEMPLATE_TALK", "Кумаг": "NS_HELP", "Кумаграясса_ихтилат": "NS_HELP_TALK", "Категория": "NS_CATEGORY", "Категориялиясса_ихтилат": "NS_CATEGORY_TALK", } wiki_ns_re_lbe = [ ("", "лиясса_ихтилат", "NS_PROJECT_TALK"), ] wiki_ns_ml = { "മീഡിയ": "NS_MEDIA", "പ്രത്യേകം": "NS_SPECIAL", "സംവാദം": "NS_TALK", "ഉപയോക്താവ്": "NS_USER", "ഉപയോക്താവിന്റെ_സംവാദം": "NS_USER_TALK", "ചിത്രം": "NS_IMAGE", "ചിത്രത്തിന്റെ_സംവാദം": "NS_IMAGE_TALK", "മീഡിയവിക്കി": "NS_MEDIAWIKI", "മീഡിയവിക്കി_സംവാദം": "NS_MEDIAWIKI_TALK", "ഫലകം": "NS_TEMPLATE", "ഫലകത്തിന്റെ_സംവാദം": "NS_TEMPLATE_TALK", "വിഭാഗം": "NS_CATEGORY", "വിഭാഗത്തിന്റെ_സംവാദം": "NS_CATEGORY_TALK", "സഹായം": "NS_HELP", "സഹായത്തിന്റെ_സംവാദം": "NS_HELP_TALK", } wiki_ns_re_ml = [ ("", "_സംവാദം", "NS_PROJECT_TALK"), ] wiki_ns_fiu_vro = { "Meediä": "NS_MEDIA", "Tallituslehekülg": "NS_SPECIAL", "Arotus": "NS_TALK", "Pruukja": "NS_USER", "Pruukja_arotus": "NS_USER_TALK", "Pilt": "NS_IMAGE", "Pildi_arotus": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_arotus": "NS_MEDIAWIKI_TALK", "Näüdüs": "NS_TEMPLATE", "Näüdüse_arotus": "NS_TEMPLATE_TALK", "Oppus": "NS_HELP", "Oppusõ_arotus": "NS_HELP_TALK", "Katõgooria": "NS_CATEGORY", "Katõgooria_arotus": "NS_CATEGORY_TALK", } wiki_ns_re_fiu_vro = [ ("", "_arotus", "NS_PROJECT_TALK"), ] wiki_ns_yi = { "מעדיע": "NS_MEDIA", "באַזונדער": "NS_SPECIAL", "רעדן": "NS_TALK", "באַניצער": "NS_USER", "באַניצער_רעדן": "NS_USER_TALK", "בילד": "NS_IMAGE", "בילד_רעדן": "NS_IMAGE_TALK", "מעדיעװיקי": "NS_MEDIAWIKI", "מעדיעװיקי_רעדן": "NS_MEDIAWIKI_TALK", "מוסטער": "NS_TEMPLATE", "מוסטער_רעדן": "NS_TEMPLATE_TALK", "הילף": "NS_HELP", "הילף_רעדן": "NS_HELP_TALK", "קאַטעגאָריע": "NS_CATEGORY", "קאַטעגאָריע_רעדן": "NS_CATEGORY_TALK", } wiki_ns_re_yi = [ ("", "_רעדן", "NS_PROJECT_TALK"), ] wiki_ns_udm = { "Медиа": "NS_MEDIA", "Панель": "NS_SPECIAL", "Вераськон": "NS_TALK", "Викиавтор": "NS_USER", "Викиавтор_сярысь_вераськон": "NS_USER_TALK", "Суред": "NS_IMAGE", "Суред_сярысь_вераськон": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_сярысь_вераськон": "NS_MEDIAWIKI_TALK", "Шаблон": "NS_TEMPLATE", "Шаблон_сярысь_вераськон": "NS_TEMPLATE_TALK", "Валэктон": "NS_HELP", "Валэктон_сярысь_вераськон": "NS_HELP_TALK", "Категория": "NS_CATEGORY", "Категория_сярысь_вераськон": "NS_CATEGORY_TALK", } wiki_ns_re_udm = [ ("", "_сярысь_вераськон", "NS_PROJECT_TALK"), ] wiki_ns_ur = { "زریعہ": "NS_MEDIA", "خاص": "NS_SPECIAL", "تبادلۂ_خیال": "NS_TALK", "صارف": "NS_USER", "تبادلۂ_خیال_صارف": "NS_USER_TALK", "تصویر": "NS_IMAGE", "تبادلۂ_خیال_تصویر": "NS_IMAGE_TALK", "میڈیاوکی": "NS_MEDIAWIKI", "تبادلۂ_خیال_میڈیاوکی": "NS_MEDIAWIKI_TALK", "سانچہ": "NS_TEMPLATE", "تبادلۂ_خیال_سانچہ": "NS_TEMPLATE_TALK", "معاونت": "NS_HELP", "تبادلۂ_خیال_معاونت": "NS_HELP_TALK", "زمرہ": "NS_CATEGORY", "تبادلۂ_خیال_زمرہ": "NS_CATEGORY_TALK", } wiki_ns_re_ur = [ ("تبادلۂ_خیال_", "", "NS_PROJECT_TALK"), ] wiki_ns_fa = { "مدیا": "NS_MEDIA", "ویژه": "NS_SPECIAL", "بحث": "NS_TALK", "کاربر": "NS_USER", "بحث_کاربر": "NS_USER_TALK", "تصویر": "NS_IMAGE", "بحث_تصویر": "NS_IMAGE_TALK", "مدیاویکی": "NS_MEDIAWIKI", "بحث_مدیاویکی": "NS_MEDIAWIKI_TALK", "الگو": "NS_TEMPLATE", "بحث_الگو": "NS_TEMPLATE_TALK", "راهنما": "NS_HELP", "بحث_راهنما": "NS_HELP_TALK", "رده": "NS_CATEGORY", "بحث_رده": "NS_CATEGORY_TALK", } wiki_ns_re_fa = [ ("بحث_", "", "NS_PROJECT_TALK"), ] wiki_ns_ku_latn = { "Medya": "NS_MEDIA", "Taybet": "NS_SPECIAL", "Nîqaş": "NS_TALK", "Bikarhêner": "NS_USER", "Bikarhêner_nîqaş": "NS_USER_TALK", "Wêne": "NS_IMAGE", "Wêne_nîqaş": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_nîqaş": "NS_MEDIAWIKI_TALK", "Şablon": "NS_TEMPLATE", "Şablon_nîqaş": "NS_TEMPLATE_TALK", "Alîkarî": "NS_HELP", "Alîkarî_nîqaş": "NS_HELP_TALK", "Kategorî": "NS_CATEGORY", "Kategorî_nîqaş": "NS_CATEGORY_TALK", } wiki_ns_re_ku_latn = [ ("", "_nîqaş", "NS_PROJECT_TALK"), ] wiki_ns_uz = { "Media": "NS_MEDIA", "Maxsus": "NS_SPECIAL", "Munozara": "NS_TALK", "Foydalanuvchi": "NS_USER", "Foydalanuvchi_munozarasi": "NS_USER_TALK", "Tasvir": "NS_IMAGE", "Tasvir_munozarasi": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_munozarasi": "NS_MEDIAWIKI_TALK", "Andoza": "NS_TEMPLATE", "Andoza_munozarasi": "NS_TEMPLATE_TALK", "Yordam": "NS_HELP", "Yordam_munozarasi": "NS_HELP_TALK", "Turkum": "NS_CATEGORY", "Turkum_munozarasi": "NS_CATEGORY_TALK", } wiki_ns_re_uz = [ ("", "_munozarasi", "NS_PROJECT_TALK"), ] wiki_ns_fi = { "Media": "NS_MEDIA", "Toiminnot": "NS_SPECIAL", "Keskustelu": "NS_TALK", "Käyttäjä": "NS_USER", "Keskustelu_käyttäjästä": "NS_USER_TALK", "Kuva": "NS_IMAGE", "Keskustelu_kuvasta": "NS_IMAGE_TALK", "Järjestelmäviesti": "NS_MEDIAWIKI", "Keskustelu_järjestelmäviestistä": "NS_MEDIAWIKI_TALK", "Malline": "NS_TEMPLATE", "Keskustelu_mallineesta": "NS_TEMPLATE_TALK", "Ohje": "NS_HELP", "Keskustelu_ohjeesta": "NS_HELP_TALK", "Luokka": "NS_CATEGORY", "Keskustelu_luokasta": "NS_CATEGORY_TALK", } wiki_ns_re_fi = [ ("Keskustelu_{{grammar:elative|", "}}", "NS_PROJECT_TALK"), ] wiki_ns_bn = { "বিশেষ": "NS_SPECIAL", "আলাপ": "NS_TALK", "ব্যবহারকারী": "NS_USER", "ব্যবহারকারী_আলাপ": "NS_USER_TALK", "চিত্র": "NS_IMAGE", "চিত্র_আলাপ": "NS_IMAGE_TALK", "MediaWiki_আলাপ": "NS_MEDIAWIKI_TALK", } wiki_ns_re_bn = [ ("", "_আলাপ", "NS_PROJECT_TALK"), ] wiki_ns_pnt = { "Μέσον": "NS_MEDIA", "Ειδικόν": "NS_SPECIAL", "Καλάτσεμαν": "NS_TALK", "Χρήστες": "NS_USER", "Καλάτσεμαν_χρήστε": "NS_USER_TALK", "Εικόναν": "NS_IMAGE", "Καλάτσεμαν_εικόνας": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_talk": "NS_MEDIAWIKI_TALK", "Πρότυπον": "NS_TEMPLATE", "Καλάτσεμαν_πρότυπι": "NS_TEMPLATE_TALK", "Βοήθειαν": "NS_HELP", "Καλάτσεμαν_βοήθειας": "NS_HELP_TALK", "Κατηγορίαν": "NS_CATEGORY", "Καλάτσεμαν_κατηγορίας": "NS_CATEGORY_TALK", } wiki_ns_re_pnt = [ ("", "_καλάτσεμαν", "NS_PROJECT_TALK"), ] wiki_ns_br = { "Media": "NS_MEDIA", "Dibar": "NS_SPECIAL", "Kaozeal": "NS_TALK", "Implijer": "NS_USER", "Kaozeadenn_Implijer": "NS_USER_TALK", "Skeudenn": "NS_IMAGE", "Kaozeadenn_Skeudenn": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Kaozeadenn_MediaWiki": "NS_MEDIAWIKI_TALK", "Patrom": "NS_TEMPLATE", "Kaozeadenn_Patrom": "NS_TEMPLATE_TALK", "Skoazell": "NS_HELP", "Kaozeadenn_Skoazell": "NS_HELP_TALK", "Rummad": "NS_CATEGORY", "Kaozeadenn_Rummad": "NS_CATEGORY_TALK", } wiki_ns_re_br = [ ("Kaozeadenn_", "", "NS_PROJECT_TALK"), ] wiki_ns_hsb = { "Media": "NS_MEDIA", "Specialnje": "NS_SPECIAL", "Diskusija": "NS_TALK", "Wužiwar": "NS_USER", "Diskusija_z_wužiwarjom": "NS_USER_TALK", "Wobraz": "NS_IMAGE", "Diskusija_k_wobrazej": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_diskusija": "NS_MEDIAWIKI_TALK", "Předłoha": "NS_TEMPLATE", "Diskusija_k_předłoze": "NS_TEMPLATE_TALK", "Pomoc": "NS_HELP", "Pomoc_diskusija": "NS_HELP_TALK", "Kategorija": "NS_CATEGORY", "Diskusija_ke_kategoriji": "NS_CATEGORY_TALK", } wiki_ns_re_hsb = [ ("", "_diskusija", "NS_PROJECT_TALK"), ] wiki_ns_no = { "Medium": "NS_MEDIA", "Spesial": "NS_SPECIAL", "Diskusjon": "NS_TALK", "Bruker": "NS_USER", "Brukerdiskusjon": "NS_USER_TALK", "Bilde": "NS_IMAGE", "Bildediskusjon": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki-diskusjon": "NS_MEDIAWIKI_TALK", "Mal": "NS_TEMPLATE", "Maldiskusjon": "NS_TEMPLATE_TALK", "Hjelp": "NS_HELP", "Hjelpdiskusjon": "NS_HELP_TALK", "Kategori": "NS_CATEGORY", "Kategoridiskusjon": "NS_CATEGORY_TALK", } wiki_ns_re_no = [ ("", "-diskusjon", "NS_PROJECT_TALK"), ] wiki_ns_vi = { "Phương_tiện": "NS_MEDIA", "Đặc_biệt": "NS_SPECIAL", "Thảo_luận": "NS_TALK", "Thành_viên": "NS_USER", "Thảo_luận_Thành_viên": "NS_USER_TALK", "Hình": "NS_IMAGE", "Thảo_luận_Hình": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Thảo_luận_MediaWiki": "NS_MEDIAWIKI_TALK", "Tiêu_bản": "NS_TEMPLATE", "Thảo_luận_Tiêu_bản": "NS_TEMPLATE_TALK", "Trợ_giúp": "NS_HELP", "Thảo_luận_Trợ_giúp": "NS_HELP_TALK", "Thể_loại": "NS_CATEGORY", "Thảo_luận_Thể_loại": "NS_CATEGORY_TALK", } wiki_ns_re_vi = [ ("Thảo_luận_", "", "NS_PROJECT_TALK"), ] wiki_ns_fy = { "Media": "NS_MEDIA", "Wiki": "NS_SPECIAL", "Oerlis": "NS_TALK", "Meidogger": "NS_USER", "Meidogger_oerlis": "NS_USER_TALK", "Ofbyld": "NS_IMAGE", "Ofbyld_oerlis": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_oerlis": "NS_MEDIAWIKI_TALK", "Berjocht": "NS_TEMPLATE", "Berjocht_oerlis": "NS_TEMPLATE_TALK", "Hulp": "NS_HELP", "Hulp_oerlis": "NS_HELP_TALK", "Kategory": "NS_CATEGORY", "Kategory_oerlis": "NS_CATEGORY_TALK", } wiki_ns_re_fy = [ ("", "_oerlis", "NS_PROJECT_TALK"), ] wiki_ns_ca = { "Media": "NS_MEDIA", "Especial": "NS_SPECIAL", "Discussió": "NS_TALK", "Usuari": "NS_USER", "Usuari_Discussió": "NS_USER_TALK", "Imatge": "NS_IMAGE", "Imatge_Discussió": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_Discussió": "NS_MEDIAWIKI_TALK", "Plantilla": "NS_TEMPLATE", "Plantilla_Discussió": "NS_TEMPLATE_TALK", "Ajuda": "NS_HELP", "Ajuda_Discussió": "NS_HELP_TALK", "Categoria": "NS_CATEGORY", "Categoria_Discussió": "NS_CATEGORY_TALK", } wiki_ns_re_ca = [ ("", "_Discussió", "NS_PROJECT_TALK"), ] wiki_ns_ce = { "Медйа": "NS_MEDIA", "Башхо": "NS_SPECIAL", "Дийца": "NS_TALK", "Юзер": "NS_USER", "Юзери_дийца": "NS_USER_TALK", "Сурт": "NS_IMAGE", "Сурти_дийца": "NS_IMAGE_TALK", "МедйаВики": "NS_MEDIAWIKI", "МедйаВики_дийца": "NS_MEDIAWIKI_TALK", "Дакъа": "NS_TEMPLATE", "Дакъан_дийца": "NS_TEMPLATE_TALK", "ГІо": "NS_HELP", "ГІодан_дийца": "NS_HELP_TALK", "Тоба": "NS_CATEGORY", "Тобан_дийца": "NS_CATEGORY_TALK", } wiki_ns_re_ce = [ ("", "_Дийца", "NS_PROJECT_TALK"), ] wiki_ns_gl = { "Media": "NS_MEDIA", "Especial": "NS_SPECIAL", "Conversa": "NS_TALK", "Usuario": "NS_USER", "Conversa_Usuario": "NS_USER_TALK", "Imaxe": "NS_IMAGE", "Conversa_Imaxe": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Conversa_MediaWiki": "NS_MEDIAWIKI_TALK", "Modelo": "NS_TEMPLATE", "Conversa_Modelo": "NS_TEMPLATE_TALK", "Axuda": "NS_HELP", "Conversa_Axuda": "NS_HELP_TALK", "Categoría": "NS_CATEGORY", "Conversa_Categoría": "NS_CATEGORY_TALK", } wiki_ns_re_gl = [ ("Conversa_", "", "NS_PROJECT_TALK"), ] wiki_ns_sa = { "Media": "NS_MEDIA", "Special": "NS_SPECIAL", "संभाषणं": "NS_TALK", "योजकः": "NS_USER", "योजकसंभाषणं": "NS_USER_TALK", "चित्रं": "NS_IMAGE", "चित्रसंभाषणं": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_talk": "NS_MEDIAWIKI_TALK", "Template": "NS_TEMPLATE", "Template_talk": "NS_TEMPLATE_TALK", "उपकारः": "NS_HELP", "उपकारसंभाषणं": "NS_HELP_TALK", "वर्गः": "NS_CATEGORY", "वर्गसंभाषणं": "NS_CATEGORY_TALK", } wiki_ns_re_sa = [ ("", "संभाषणं", "NS_PROJECT_TALK"), ] wiki_ns_tt_latn = { "Media": "NS_MEDIA", "Maxsus": "NS_SPECIAL", "Bäxäs": "NS_TALK", "Äğzä": "NS_USER", "Äğzä_bäxäse": "NS_USER_TALK", "Räsem": "NS_IMAGE", "Räsem_bäxäse": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_bäxäse": "NS_MEDIAWIKI_TALK", "Ürnäk": "NS_TEMPLATE", "Ürnäk_bäxäse": "NS_TEMPLATE_TALK", "Yärdäm": "NS_HELP", "Yärdäm_bäxäse": "NS_HELP_TALK", "Törkem": "NS_CATEGORY", "Törkem_bäxäse": "NS_CATEGORY_TALK", } wiki_ns_re_tt_latn = [ ("", "_bäxäse", "NS_PROJECT_TALK"), ] wiki_ns_cu = { "Срѣ́дьства": "NS_MEDIA", "Наро́чьна": "NS_SPECIAL", "Бєсѣ́да": "NS_TALK", "По́льꙃєватєл҄ь": "NS_USER", "По́льꙃєватєлꙗ_бєсѣ́да": "NS_USER_TALK", "Ви́дъ": "NS_IMAGE", "Ви́да_бєсѣ́да": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_бєсѣ́да": "NS_MEDIAWIKI_TALK", "Обраꙁь́ць": "NS_TEMPLATE", "Обраꙁьца́_бєсѣ́да": "NS_TEMPLATE_TALK", "По́мощь": "NS_HELP", "По́мощи_бєсѣ́да": "NS_HELP_TALK", "Катигорі́ꙗ": "NS_CATEGORY", "Катигорі́ѩ_бєсѣ́да": "NS_CATEGORY_TALK", } wiki_ns_re_cu = [ ("{{grammar:genitive|", "}}_бєсѣ́да", "NS_PROJECT_TALK"), ] wiki_ns_ko = { "Media": "NS_MEDIA", "특수기능": "NS_SPECIAL", "토론": "NS_TALK", "사용자": "NS_USER", "사용자토론": "NS_USER_TALK", "그림": "NS_IMAGE", "그림토론": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki토론": "NS_MEDIAWIKI_TALK", "틀": "NS_TEMPLATE", "틀토론": "NS_TEMPLATE_TALK", "도움말": "NS_HELP", "도움말토론": "NS_HELP_TALK", "분류": "NS_CATEGORY", "분류토론": "NS_CATEGORY_TALK", } wiki_ns_re_ko = [ ("", "토론", "NS_PROJECT_TALK"), ] wiki_ns_cy = { "Media": "NS_MEDIA", "Arbennig": "NS_SPECIAL", "Sgwrs": "NS_TALK", "Defnyddiwr": "NS_USER", "Sgwrs_Defnyddiwr": "NS_USER_TALK", "Delwedd": "NS_IMAGE", "Sgwrs_Delwedd": "NS_IMAGE_TALK", "MediaWici": "NS_MEDIAWIKI", "Sgwrs_MediaWici": "NS_MEDIAWIKI_TALK", "Nodyn": "NS_TEMPLATE", "Sgwrs_Nodyn": "NS_TEMPLATE_TALK", "Categori": "NS_CATEGORY", "Sgwrs_Categori": "NS_CATEGORY_TALK", "Cymorth": "NS_HELP", "Sgwrs Cymorth": "NS_HELP_TALK", } wiki_ns_re_cy = [ ("Sgwrs_", "", "NS_PROJECT_TALK"), ] wiki_ns_si = { "මාධ්‍යය": "NS_MEDIA", "විශේෂ": "NS_SPECIAL", "සාකච්ඡාව": "NS_TALK", "පරිශීලක": "NS_USER", "පරිශීලක_සාකච්ඡාව": "NS_USER_TALK", "රූපය": "NS_IMAGE", "රූපය_සාකච්ඡාව": "NS_IMAGE_TALK", "විකිමාධ්‍ය": "NS_MEDIAWIKI", "විකිමාධ්‍ය_සාකච්ඡාව": "NS_MEDIAWIKI_TALK", "සැකිල්ල": "NS_TEMPLATE", "සැකිල_සාකච්ඡාව": "NS_TEMPLATE_TALK", "උදවු": "NS_HELP", "උදව_සාකච්ඡාව": "NS_HELP_TALK", "ප්‍රවර්ගය": "NS_CATEGORY", "ප්‍රවර්ග_සාකච්ඡාව": "NS_CATEGORY_TALK", } wiki_ns_re_si = [ ("", "_සාකච්ඡාව", "NS_PROJECT_TALK"), ] wiki_ns_sq = { "Media": "NS_MEDIA", "Speciale": "NS_SPECIAL", "Diskutim": "NS_TALK", "Përdoruesi": "NS_USER", "Përdoruesi_diskutim": "NS_USER_TALK", "Figura": "NS_IMAGE", "Figura_diskutim": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_diskutim": "NS_MEDIAWIKI_TALK", "Stampa": "NS_TEMPLATE", "Stampa_diskutim": "NS_TEMPLATE_TALK", "Ndihmë": "NS_HELP", "Ndihmë_diskutim": "NS_HELP_TALK", } wiki_ns_re_sq = [ ("", "_diskutim", "NS_PROJECT_TALK"), ] wiki_ns_su = { "Média": "NS_MEDIA", "Husus": "NS_SPECIAL", "Obrolan": "NS_TALK", "Pamaké": "NS_USER", "Obrolan_pamaké": "NS_USER_TALK", "Gambar": "NS_IMAGE", "Obrolan_gambar": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Obrolan_MediaWiki": "NS_MEDIAWIKI_TALK", "Citakan": "NS_TEMPLATE", "Obrolan_citakan": "NS_TEMPLATE_TALK", "Pitulung": "NS_HELP", "Obrolan_pitulung": "NS_HELP_TALK", "Kategori": "NS_CATEGORY", "Obrolan_kategori": "NS_CATEGORY_TALK", } wiki_ns_re_su = [ ("Obrolan_", "", "NS_PROJECT_TALK"), ] wiki_ns_arz = { "ميديا": "NS_MEDIA", "خاص": "NS_SPECIAL", "نقاش": "NS_TALK", "مستخدم": "NS_USER", "نقاش_المستخدم": "NS_USER_TALK", "صورة": "NS_IMAGE", "نقاش_الصورة": "NS_IMAGE_TALK", "ميدياويكى": "NS_MEDIAWIKI", "نقاش_ميدياويكى": "NS_MEDIAWIKI_TALK", "قالب": "NS_TEMPLATE", "نقاش_القالب": "NS_TEMPLATE_TALK", "مساعدة": "NS_HELP", "نقاش_المساعدة": "NS_HELP_TALK", "تصنيف": "NS_CATEGORY", "نقاش_التصنيف": "NS_CATEGORY_TALK", } wiki_ns_re_arz = [ ("نقاش_", "", "NS_PROJECT_TALK"), ] wiki_ns_lb = { "Media": "NS_MEDIA", "Spezial": "NS_SPECIAL", "Diskussioun": "NS_TALK", "Benotzer": "NS_USER", "Benotzer_Diskussioun": "NS_USER_TALK", "Bild": "NS_IMAGE", "Bild_Diskussioun": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_Diskussioun": "NS_MEDIAWIKI_TALK", "Schabloun": "NS_TEMPLATE", "Schabloun_Diskussioun": "NS_TEMPLATE_TALK", "Hëllef": "NS_HELP", "Hëllef_Diskussioun": "NS_HELP_TALK", "Kategorie": "NS_CATEGORY", "Kategorie_Diskussioun": "NS_CATEGORY_TALK", } wiki_ns_re_lb = [ ("", "_Diskussioun", "NS_PROJECT_TALK"), ] wiki_ns_pa = { "ਮੀਡੀਆ": "NS_MEDIA", "ਖਾਸ": "NS_SPECIAL", "ਚਰਚਾ": "NS_TALK", "ਮੈਂਬਰ": "NS_USER", "ਮੈਂਬਰ_ਚਰਚਾ": "NS_USER_TALK", "ਤਸਵੀਰ": "NS_IMAGE", "ਤਸਵੀਰ_ਚਰਚਾ": "NS_IMAGE_TALK", "ਮੀਡੀਆਵਿਕਿ": "NS_MEDIAWIKI", "ਮੀਡੀਆਵਿਕਿ_ਚਰਚਾ": "NS_MEDIAWIKI_TALK", "ਨਮੂਨਾ": "NS_TEMPLATE", "ਨਮੂਨਾ_ਚਰਚਾ": "NS_TEMPLATE_TALK", "ਮਦਦ": "NS_HELP", "ਮਦਦ_ਚਰਚਾ": "NS_HELP_TALK", "ਸ਼੍ਰੇਣੀ": "NS_CATEGORY", "ਸ਼੍ਰੇਣੀ_ਚਰਚਾ": "NS_CATEGORY_TALK", } wiki_ns_re_pa = [ ("", "_ਚਰਚਾ", "NS_PROJECT_TALK"), ] wiki_ns_csb = { "Media": "NS_MEDIA", "Specjalnô": "NS_SPECIAL", "Diskùsëjô": "NS_TALK", "Brëkòwnik": "NS_USER", "Diskùsëjô_brëkòwnika": "NS_USER_TALK", "Òbrôzk": "NS_IMAGE", "Diskùsëjô_òbrôzków": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Diskùsëjô_MediaWiki": "NS_MEDIAWIKI_TALK", "Szablóna": "NS_TEMPLATE", "Diskùsëjô_Szablónë": "NS_TEMPLATE_TALK", "Pòmòc": "NS_HELP", "Diskùsëjô_Pòmòcë": "NS_HELP_TALK", "Kategòrëjô": "NS_CATEGORY", "Diskùsëjô_Kategòrëji": "NS_CATEGORY_TALK", } wiki_ns_re_csb = [ ("Diskùsëjô_", "", "NS_PROJECT_TALK"), ] wiki_ns_th = { "สื่อ": "NS_MEDIA", "พิเศษ": "NS_SPECIAL", "พูดคุย": "NS_TALK", "ผู้ใช้": "NS_USER", "คุยกับผู้ใช้": "NS_USER_TALK", "ภาพ": "NS_IMAGE", "คุยเรื่องภาพ": "NS_IMAGE_TALK", "มีเดียวิกิ": "NS_MEDIAWIKI", "คุยเรื่องมีเดียวิกิ": "NS_MEDIAWIKI_TALK", "แม่แบบ": "NS_TEMPLATE", "คุยเรื่องแม่แบบ": "NS_TEMPLATE_TALK", "วิธีใช้": "NS_HELP", "คุยเรื่องวิธีใช้": "NS_HELP_TALK", "หมวดหมู่": "NS_CATEGORY", "คุยเรื่องหมวดหมู่": "NS_CATEGORY_TALK", } wiki_ns_re_th = [ ("คุยเรื่อง", "", "NS_PROJECT_TALK"), ] wiki_ns_vec = { "Media": "NS_MEDIA", "Speciale": "NS_SPECIAL", "Discussion": "NS_TALK", "Utente": "NS_USER", "Discussion_utente": "NS_USER_TALK", "Imagine": "NS_IMAGE", "Discussion_imagine": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Discussion_MediaWiki": "NS_MEDIAWIKI_TALK", "Template": "NS_TEMPLATE", "Discussion_template": "NS_TEMPLATE_TALK", "Aiuto": "NS_HELP", "Discussion_aiuto": "NS_HELP_TALK", "Categoria": "NS_CATEGORY", "Discussion_categoria": "NS_CATEGORY_TALK", } wiki_ns_re_vec = [ ("Discussion_", "", "NS_PROJECT_TALK"), ] wiki_ns_zea = { "Media": "NS_MEDIA", "Speciaol": "NS_SPECIAL", "Overleg": "NS_TALK", "Gebruker": "NS_USER", "Overleg_gebruker": "NS_USER_TALK", "Plaetje": "NS_IMAGE", "Overleg_plaetje": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Overleg_MediaWiki": "NS_MEDIAWIKI_TALK", "Sjabloon": "NS_TEMPLATE", "Overleg_sjabloon": "NS_TEMPLATE_TALK", "Ulpe": "NS_HELP", "Overleg_ulpe": "NS_HELP_TALK", "Categorie": "NS_CATEGORY", "Overleg_categorie": "NS_CATEGORY_TALK", } wiki_ns_re_zea = [ ("Overleg_", "", "NS_PROJECT_TALK"), ] wiki_ns_lv = { "Media": "NS_MEDIA", "Special": "NS_SPECIAL", "Diskusija": "NS_TALK", "Lietotājs": "NS_USER", "Lietotāja_diskusija": "NS_USER_TALK", "Attēls": "NS_IMAGE", "Attēla_diskusija": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_diskusija": "NS_MEDIAWIKI_TALK", "Veidne": "NS_TEMPLATE", "Veidnes_diskusija": "NS_TEMPLATE_TALK", "Palīdzība": "NS_HELP", "Palīdzības_diskusija": "NS_HELP_TALK", "Kategorija": "NS_CATEGORY", "Kategorijas_diskusija": "NS_CATEGORY_TALK", } wiki_ns_re_lv = [ ("{{grammar:ģenitīvs|", "}}_diskusija", "NS_PROJECT_TALK"), ] wiki_ns_scn = { "Mèdia": "NS_MEDIA", "Spiciali": "NS_SPECIAL", "Discussioni": "NS_TALK", "Utenti": "NS_USER", "Discussioni_utenti": "NS_USER_TALK", "Mmàggini": "NS_IMAGE", "Discussioni_mmàggini": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Discussioni_MediaWiki": "NS_MEDIAWIKI_TALK", "Template": "NS_TEMPLATE", "Discussioni_template": "NS_TEMPLATE_TALK", "Aiutu": "NS_HELP", "Discussioni_aiutu": "NS_HELP_TALK", "Catigurìa": "NS_CATEGORY", "Discussioni_catigurìa": "NS_CATEGORY_TALK", } wiki_ns_re_scn = [ ("Discussioni_", "", "NS_PROJECT_TALK"), ] wiki_ns_new = { "माध्यम": "NS_MEDIA", "विशेष": "NS_SPECIAL", "खँलाबँला": "NS_TALK", "छ्येलेमि": "NS_USER", "छ्येलेमि_खँलाबँला": "NS_USER_TALK", "किपा": "NS_IMAGE", "किपा_खँलाबँला": "NS_IMAGE_TALK", "मिडियाविकि": "NS_MEDIAWIKI", "मिडियाविकि_खँलाबँला": "NS_MEDIAWIKI_TALK", "ग्वाहालि": "NS_HELP", "ग्वाहालि_खँलाबँला": "NS_HELP_TALK", "पुचः": "NS_CATEGORY", "पुचः_खँलाबँला": "NS_CATEGORY_TALK", } wiki_ns_re_new = [ ("", "_खँलाबँला", "NS_PROJECT_TALK"), ] wiki_ns_zh_tw = { "媒體": "NS_MEDIA", "特殊": "NS_SPECIAL", "討論": "NS_TALK", "使用者": "NS_USER", "使用者討論": "NS_USER_TALK", "圖片": "NS_IMAGE", "圖片討論": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_talk": "NS_MEDIAWIKI_TALK", "模板": "NS_TEMPLATE", "模板討論": "NS_TEMPLATE_TALK", "使用說明": "NS_HELP", "使用說明討論": "NS_HELP_TALK", "分類": "NS_CATEGORY", "分類討論": "NS_CATEGORY_TALK", } wiki_ns_re_zh_tw = [ ("", "對話", "NS_PROJECT_TALK"), ] wiki_ns_eo = { "Media": "NS_MEDIA", "Speciala": "NS_SPECIAL", "Diskuto": "NS_TALK", "Vikipediisto": "NS_USER", "Vikipediista_diskuto": "NS_USER_TALK", "Dosiero": "NS_IMAGE", "Dosiera_diskuto": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_diskuto": "NS_MEDIAWIKI_TALK", "Ŝablono": "NS_TEMPLATE", "Ŝablona_diskuto": "NS_TEMPLATE_TALK", "Helpo": "NS_HELP", "Helpa_diskuto": "NS_HELP_TALK", "Kategorio": "NS_CATEGORY", "Kategoria_diskuto": "NS_CATEGORY_TALK", } wiki_ns_re_eo = [ ("", "_diskuto", "NS_PROJECT_TALK"), ] wiki_ns_es = { "Media": "NS_MEDIA", "Especial": "NS_SPECIAL", "Discusión": "NS_TALK", "Usuario": "NS_USER", "Usuario_Discusión": "NS_USER_TALK", "Imagen": "NS_IMAGE", "Imagen_Discusión": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_Discusión": "NS_MEDIAWIKI_TALK", "Plantilla": "NS_TEMPLATE", "Plantilla_Discusión": "NS_TEMPLATE_TALK", "Ayuda": "NS_HELP", "Ayuda_Discusión": "NS_HELP_TALK", "Categoría": "NS_CATEGORY", "Categoría_Discusión": "NS_CATEGORY_TALK", } wiki_ns_re_es = [ ("", "_Discusión", "NS_PROJECT_TALK"), ] wiki_ns_uk = { "Медіа": "NS_MEDIA", "Спеціальна": "NS_SPECIAL", "Обговорення": "NS_TALK", "Користувач": "NS_USER", "Обговорення_користувача": "NS_USER_TALK", "Зображення": "NS_IMAGE", "Обговорення_зображення": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Обговорення_MediaWiki": "NS_MEDIAWIKI_TALK", "Шаблон": "NS_TEMPLATE", "Обговорення_шаблону": "NS_TEMPLATE_TALK", "Довідка": "NS_HELP", "Обговорення_довідки": "NS_HELP_TALK", "Категорія": "NS_CATEGORY", "Обговорення_категорії": "NS_CATEGORY_TALK", } wiki_ns_re_uk = [ ("Обговорення_{{grammar:genitive|", "}}", "NS_PROJECT_TALK"), ] wiki_ns_bg = { "Медия": "NS_MEDIA", "Специални": "NS_SPECIAL", "Беседа": "NS_TALK", "Потребител": "NS_USER", "Потребител_беседа": "NS_USER_TALK", "Картинка": "NS_IMAGE", "Картинка_беседа": "NS_IMAGE_TALK", "МедияУики": "NS_MEDIAWIKI", "МедияУики_беседа": "NS_MEDIAWIKI_TALK", "Шаблон": "NS_TEMPLATE", "Шаблон_беседа": "NS_TEMPLATE_TALK", "Помощ": "NS_HELP", "Помощ_беседа": "NS_HELP_TALK", "Категория": "NS_CATEGORY", "Категория_беседа": "NS_CATEGORY_TALK", } wiki_ns_re_bg = [ ("", "_беседа", "NS_PROJECT_TALK"), ] wiki_ns_ja = { "Media": "NS_MEDIA", "特別": "NS_SPECIAL", "ノート": "NS_TALK", "利用者": "NS_USER", "利用者‐会話": "NS_USER_TALK", "画像": "NS_IMAGE", "画像‐ノート": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki‐ノート": "NS_MEDIAWIKI_TALK", "Template": "NS_TEMPLATE", "Template‐ノート": "NS_TEMPLATE_TALK", "Help": "NS_HELP", "Help‐ノート": "NS_HELP_TALK", "Category": "NS_CATEGORY", "Category‐ノート": "NS_CATEGORY_TALK", } wiki_ns_re_ja = [ ("", "‐ノート", "NS_PROJECT_TALK"), ] wiki_ns_kaa = { "Media": "NS_MEDIA", "Arnawlı": "NS_SPECIAL", "Sa'wbet": "NS_TALK", "Paydalanıwshı": "NS_USER", "Paydalanıwshı_sa'wbeti": "NS_USER_TALK", "Su'wret": "NS_IMAGE", "Su'wret_sa'wbeti": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_sa'wbeti": "NS_MEDIAWIKI_TALK", "Shablon": "NS_TEMPLATE", "Shablon_sa'wbeti": "NS_TEMPLATE_TALK", "Anıqlama": "NS_HELP", "Anıqlama_sa'wbeti": "NS_HELP_TALK", "Kategoriya": "NS_CATEGORY", "Kategoriya_sa'wbeti": "NS_CATEGORY_TALK", } wiki_ns_re_kaa = [ ("", "_sa'wbeti", "NS_PROJECT_TALK"), ] wiki_ns_bcl = { "Medio": "NS_MEDIA", "Espesyal": "NS_SPECIAL", "Olay": "NS_TALK", "Paragamit": "NS_USER", "Olay_kan_paragamit": "NS_USER_TALK", "Ladawan": "NS_IMAGE", "Olay_sa_ladawan": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Olay_sa_MediaWiki": "NS_MEDIAWIKI_TALK", "Plantilya": "NS_TEMPLATE", "Olay_sa_plantilya": "NS_TEMPLATE_TALK", "Tabang": "NS_HELP", "Olay_sa_tabang": "NS_HELP_TALK", "Kategorya": "NS_CATEGORY", "Olay_sa_kategorya": "NS_CATEGORY_TALK", } wiki_ns_re_bcl = [ ("Olay_sa_", "", "NS_PROJECT_TALK"), ] wiki_ns_bs = { "Medija": "NS_MEDIA", "Posebno": "NS_SPECIAL", "Razgovor": "NS_TALK", "Korisnik": "NS_USER", "Razgovor_sa_korisnikom": "NS_USER_TALK", "Slika": "NS_IMAGE", "Razgovor_o_slici": "NS_IMAGE_TALK", "MedijaViki": "NS_MEDIAWIKI", "Razgovor_o_MedijaVikiju": "NS_MEDIAWIKI_TALK", "Šablon": "NS_TEMPLATE", "Razgovor_o_šablonu": "NS_TEMPLATE_TALK", "Pomoć": "NS_HELP", "Razgovor_o_pomoći": "NS_HELP_TALK", "Kategorija": "NS_CATEGORY", "Razgovor_o_kategoriji": "NS_CATEGORY_TALK", } wiki_ns_re_bs = [ ("Razgovor_{{grammar:instrumental|", "}}", "NS_PROJECT_TALK"), ] wiki_ns_stq = { "Media": "NS_MEDIA", "Spezial": "NS_SPECIAL", "Diskussion": "NS_TALK", "Benutser": "NS_USER", "Benutser_Diskussion": "NS_USER_TALK", "Bielde": "NS_IMAGE", "Bielde_Diskussion": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_Diskussion": "NS_MEDIAWIKI_TALK", "Foarloage": "NS_TEMPLATE", "Foarloage_Diskussion": "NS_TEMPLATE_TALK", "Hälpe": "NS_HELP", "Hälpe_Diskussion": "NS_HELP_TALK", "Kategorie": "NS_CATEGORY", "Kategorie_Diskussion": "NS_CATEGORY_TALK", } wiki_ns_re_stq = [ ("", "_Diskussion", "NS_PROJECT_TALK"), ] wiki_ns_fr = { "Media": "NS_MEDIA", "Special": "NS_SPECIAL", "Discuter": "NS_TALK", "Utilisateur": "NS_USER", "Discussion_Utilisateur": "NS_USER_TALK", "Image": "NS_IMAGE", "Discussion_Image": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Discussion_MediaWiki": "NS_MEDIAWIKI_TALK", "Modèle": "NS_TEMPLATE", "Discussion_Modèle": "NS_TEMPLATE_TALK", "Aide": "NS_HELP", "Discussion_Aide": "NS_HELP_TALK", "Catégorie": "NS_CATEGORY", "Discussion_Catégorie": "NS_CATEGORY_TALK", } wiki_ns_re_fr = [ ("", "", "NS_PROJECT"), ("Discussion_", "", "NS_PROJECT_TALK"), ] wiki_ns_nl = { "Media": "NS_MEDIA", "Speciaal": "NS_SPECIAL", "Overleg": "NS_TALK", "Gebruiker": "NS_USER", "Overleg_gebruiker": "NS_USER_TALK", "Afbeelding": "NS_IMAGE", "Overleg_afbeelding": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Overleg_MediaWiki": "NS_MEDIAWIKI_TALK", "Sjabloon": "NS_TEMPLATE", "Overleg_sjabloon": "NS_TEMPLATE_TALK", "Help": "NS_HELP", "Overleg_help": "NS_HELP_TALK", "Categorie": "NS_CATEGORY", "Overleg_categorie": "NS_CATEGORY_TALK", } wiki_ns_re_nl = [ ("Overleg_", "", "NS_PROJECT_TALK"), ] wiki_ns_ro = { "Media": "NS_MEDIA", "Special": "NS_SPECIAL", "Discuţie": "NS_TALK", "Utilizator": "NS_USER", "Discuţie_Utilizator": "NS_USER_TALK", "Imagine": "NS_IMAGE", "Discuţie_Imagine": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Discuţie_MediaWiki": "NS_MEDIAWIKI_TALK", "Format": "NS_TEMPLATE", "Discuţie_Format": "NS_TEMPLATE_TALK", "Ajutor": "NS_HELP", "Discuţie_Ajutor": "NS_HELP_TALK", "Categorie": "NS_CATEGORY", "Discuţie_Categorie": "NS_CATEGORY_TALK", } wiki_ns_re_ro = [ ("Discuţie_", "", "NS_PROJECT_TALK"), ] wiki_ns_ga = { "Meán": "NS_MEDIA", "Speisialta": "NS_SPECIAL", "Plé": "NS_TALK", "Úsáideoir": "NS_USER", "Plé_úsáideora": "NS_USER_TALK", "Íomhá": "NS_IMAGE", "Plé_íomhá": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Plé_MediaWiki": "NS_MEDIAWIKI_TALK", "Teimpléad": "NS_TEMPLATE", "Plé_teimpléid": "NS_TEMPLATE_TALK", "Cabhair": "NS_HELP", "Plé_cabhrach": "NS_HELP_TALK", "Catagóir": "NS_CATEGORY", "Plé_catagóire": "NS_CATEGORY_TALK", } wiki_ns_re_ga = [ ("Plé_{{grammar:genitive|", "}}", "NS_PROJECT_TALK"), ] wiki_ns_sr_ec = { "Медија": "NS_MEDIA", "Посебно": "NS_SPECIAL", "Разговор": "NS_TALK", "Корисник": "NS_USER", "Разговор_са_корисником": "NS_USER_TALK", "Слика": "NS_IMAGE", "Разговор_о_слици": "NS_IMAGE_TALK", "МедијаВики": "NS_MEDIAWIKI", "Разговор_о_МедијаВикију": "NS_MEDIAWIKI_TALK", "Шаблон": "NS_TEMPLATE", "Разговор_о_шаблону": "NS_TEMPLATE_TALK", "Помоћ": "NS_HELP", "Разговор_о_помоћи": "NS_HELP_TALK", "Категорија": "NS_CATEGORY", "Разговор_о_категорији": "NS_CATEGORY_TALK", } wiki_ns_re_sr_ec = [ ("Разговор_о_", "", "NS_PROJECT_TALK"), ] wiki_ns_kk_cyrl = { "Таспа": "NS_MEDIA", "Арнайы": "NS_SPECIAL", "Талқылау": "NS_TALK", "Қатысушы": "NS_USER", "Қатысушы_талқылауы": "NS_USER_TALK", "Сурет": "NS_IMAGE", "Сурет_талқылауы": "NS_IMAGE_TALK", "МедиаУики": "NS_MEDIAWIKI", "МедиаУики_талқылауы": "NS_MEDIAWIKI_TALK", "Үлгі": "NS_TEMPLATE", "Үлгі_талқылауы": "NS_TEMPLATE_TALK", "Анықтама": "NS_HELP", "Анықтама_талқылауы": "NS_HELP_TALK", "Санат": "NS_CATEGORY", "Санат_талқылауы": "NS_CATEGORY_TALK", } wiki_ns_re_kk_cyrl = [ ("", "_талқылауы", "NS_PROJECT_TALK"), ] wiki_ns_oc = { "Mèdia": "NS_MEDIA", "Especial": "NS_SPECIAL", "Discutir": "NS_TALK", "Utilizaire": "NS_USER", "Discussion_Utilizaire": "NS_USER_TALK", "Imatge": "NS_IMAGE", "Discussion_Imatge": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Discussion_MediaWiki": "NS_MEDIAWIKI_TALK", "Modèl": "NS_TEMPLATE", "Discussion_Modèl": "NS_TEMPLATE_TALK", "Ajuda": "NS_HELP", "Discussion_Ajuda": "NS_HELP_TALK", "Categoria": "NS_CATEGORY", "Discussion_Categoria": "NS_CATEGORY_TALK", } wiki_ns_re_oc = [ ("Discussion_", "", "NS_PROJECT_TALK"), ] wiki_ns_wa = { "Media": "NS_MEDIA", "Sipeciås": "NS_SPECIAL", "Copene": "NS_TALK", "Uzeu": "NS_USER", "Uzeu_copene": "NS_USER_TALK", "Imådje": "NS_IMAGE", "Imådje_copene": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_copene": "NS_MEDIAWIKI_TALK", "Modele": "NS_TEMPLATE", "Modele_copene": "NS_TEMPLATE_TALK", "Aidance": "NS_HELP", "Aidance_copene": "NS_HELP_TALK", "Categoreye": "NS_CATEGORY", "Categoreye_copene": "NS_CATEGORY_TALK", } wiki_ns_re_wa = [ ("", "_copene", "NS_PROJECT_TALK"), ] wiki_ns_cv = { "Медиа": "NS_MEDIA", "Ятарлă": "NS_SPECIAL", "Сӳтсе явасси": "NS_TALK", "Хутшăнакан": "NS_USER", "Хутшăнаканăн_канашлу_страници": "NS_USER_TALK", "Ӳкерчĕк": "NS_IMAGE", "Ӳкерчĕке_сӳтсе_явмалли": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_сӳтсе_явмалли": "NS_MEDIAWIKI_TALK", "Шаблон": "NS_TEMPLATE", "Шаблона_сӳтсе_явмалли": "NS_TEMPLATE_TALK", "Пулăшу": "NS_HELP", "Пулăшăва_сӳтсе_явмалли": "NS_HELP_TALK", "Категори": "NS_CATEGORY", "Категорине_сӳтсе_явмалли": "NS_CATEGORY_TALK", } wiki_ns_re_cv = [ ("", "_сӳтсе_явмалли", "NS_PROJECT_TALK"), ] wiki_ns_os = { "Media": "NS_MEDIA", "Сæрмагонд": "NS_SPECIAL", "Дискусси": "NS_TALK", "Архайæг": "NS_USER", "Архайæджы_дискусси": "NS_USER_TALK", "Ныв": "NS_IMAGE", "Нывы_тыххæй_дискусси": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Дискусси_MediaWiki": "NS_MEDIAWIKI_TALK", "Шаблон": "NS_TEMPLATE", "Шаблоны_тыххæй_дискусси": "NS_TEMPLATE_TALK", "Æххуыс": "NS_HELP", "Æххуысы_тыххæй_дискусси": "NS_HELP_TALK", "Категори": "NS_CATEGORY", "Категорийы_тыххæй_дискусси": "NS_CATEGORY_TALK", } wiki_ns_re_os = [ ("Дискусси_", "", "NS_PROJECT_TALK"), ] wiki_ns_kk_latn = { "Taspa": "NS_MEDIA", "Arnaýı": "NS_SPECIAL", "Talqılaw": "NS_TALK", "Qatıswşı": "NS_USER", "Qatıswşı_talqılawı": "NS_USER_TALK", "Swret": "NS_IMAGE", "Swret_talqılawı": "NS_IMAGE_TALK", "MedïaWïkï": "NS_MEDIAWIKI", "MedïaWïkï_talqılawı": "NS_MEDIAWIKI_TALK", "Ülgi": "NS_TEMPLATE", "Ülgi_talqılawı": "NS_TEMPLATE_TALK", "Anıqtama": "NS_HELP", "Anıqtama_talqılawı": "NS_HELP_TALK", "Sanat": "NS_CATEGORY", "Sanat_talqılawı": "NS_CATEGORY_TALK", } wiki_ns_re_kk_latn = [ ("", "_talqılawı", "NS_PROJECT_TALK"), ] wiki_ns_da = { "Media": "NS_MEDIA", "Speciel": "NS_SPECIAL", "Diskussion": "NS_TALK", "Bruger": "NS_USER", "Brugerdiskussion": "NS_USER_TALK", "Billede": "NS_IMAGE", "Billeddiskussion": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki-diskussion": "NS_MEDIAWIKI_TALK", "Skabelon": "NS_TEMPLATE", "Skabelondiskussion": "NS_TEMPLATE_TALK", "Hjælp": "NS_HELP", "Hjælp-diskussion": "NS_HELP_TALK", "Kategori": "NS_CATEGORY", "Kategoridiskussion": "NS_CATEGORY_TALK", } wiki_ns_re_da = [ ("", "-diskussion", "NS_PROJECT_TALK"), ] wiki_ns_sv = { "Media": "NS_MEDIA", "Special": "NS_SPECIAL", "Diskussion": "NS_TALK", "Användare": "NS_USER", "Användardiskussion": "NS_USER_TALK", "Bild": "NS_IMAGE", "Bilddiskussion": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki-diskussion": "NS_MEDIAWIKI_TALK", "Mall": "NS_TEMPLATE", "Malldiskussion": "NS_TEMPLATE_TALK", "Hjälp": "NS_HELP", "Hjälpdiskussion": "NS_HELP_TALK", "Kategori": "NS_CATEGORY", "Kategoridiskussion": "NS_CATEGORY_TALK", } wiki_ns_re_sv = [ ("", "diskussion", "NS_PROJECT_TALK"), ] wiki_ns_de = { "Media": "NS_MEDIA", "Spezial": "NS_SPECIAL", "Diskussion": "NS_TALK", "Benutzer": "NS_USER", "Benutzer_Diskussion": "NS_USER_TALK", "Bild": "NS_IMAGE", "Bild_Diskussion": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_Diskussion": "NS_MEDIAWIKI_TALK", "Vorlage": "NS_TEMPLATE", "Vorlage_Diskussion": "NS_TEMPLATE_TALK", "Hilfe": "NS_HELP", "Hilfe_Diskussion": "NS_HELP_TALK", "Kategorie": "NS_CATEGORY", "Kategorie_Diskussion": "NS_CATEGORY_TALK", } wiki_ns_re_de = [ ("", "_Diskussion", "NS_PROJECT_TALK"), ] wiki_ns_ta = { "ஊடகம்": "NS_MEDIA", "சிறப்பு": "NS_SPECIAL", "பேச்சு": "NS_TALK", "பயனர்": "NS_USER", "பயனர்_பேச்சு": "NS_USER_TALK", "படிமம்": "NS_IMAGE", "படிமப்_பேச்சு": "NS_IMAGE_TALK", "மீடியாவிக்கி": "NS_MEDIAWIKI", "மீடியாவிக்கி_பேச்சு": "NS_MEDIAWIKI_TALK", "வார்ப்புரு": "NS_TEMPLATE", "வார்ப்புரு_பேச்சு": "NS_TEMPLATE_TALK", "உதவி": "NS_HELP", "உதவி_பேச்சு": "NS_HELP_TALK", "பகுப்பு": "NS_CATEGORY", "பகுப்பு_பேச்சு": "NS_CATEGORY_TALK", } wiki_ns_re_ta = [ ("", "_பேச்சு", "NS_PROJECT_TALK"), ] wiki_ns_vls = { "Media": "NS_MEDIA", "Specioal": "NS_SPECIAL", "Discuusje": "NS_TALK", "Gebruker": "NS_USER", "Discuusje_gebruker": "NS_USER_TALK", "Ofbeeldienge": "NS_IMAGE", "Discuusje_ofbeeldienge": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Discuusje_MediaWiki": "NS_MEDIAWIKI_TALK", "Patrôon": "NS_TEMPLATE", "Discuusje_patrôon": "NS_TEMPLATE_TALK", "Ulpe": "NS_HELP", "Discuusje_ulpe": "NS_HELP_TALK", "Categorie": "NS_CATEGORY", "Discuusje_categorie": "NS_CATEGORY_TALK", } wiki_ns_re_vls = [ ("Discuusje_", "", "NS_PROJECT_TALK"), ] wiki_ns_te = { "మీడియా": "NS_MEDIA", "ప్రత్యేక": "NS_SPECIAL", "చర్చ": "NS_TALK", "సభ్యులు": "NS_USER", "సభ్యులపై_చర్చ": "NS_USER_TALK", "బొమ్మ": "NS_IMAGE", "బొమ్మపై_చర్చ": "NS_IMAGE_TALK", "మీడియావికీ": "NS_MEDIAWIKI", "మీడియావికీ_చర్చ": "NS_MEDIAWIKI_TALK", "మూస": "NS_TEMPLATE", "మూస_చర్చ": "NS_TEMPLATE_TALK", "సహాయము": "NS_HELP", "సహాయము_చర్చ": "NS_HELP_TALK", "వర్గం": "NS_CATEGORY", "వర్గం_చర్చ": "NS_CATEGORY_TALK", } wiki_ns_re_te = [ ("", "_చర్చ", "NS_PROJECT_TALK"), ] wiki_ns_lo = { "ສື່ອ": "NS_MEDIA", "ພິເສດ": "NS_SPECIAL", "ສົນທະນາ": "NS_TALK", "ຜູ້ໃຊ້": "NS_USER", "ສົນທະນາຂອງຜູ້ໃຊ້": "NS_USER_TALK", "ຮູບ": "NS_IMAGE", "ສົນທະນາກ່ຽວກັບຮູບ": "NS_IMAGE_TALK", "ມີເດຍວິກິ": "NS_MEDIAWIKI", "ສົນທະນາກ່ຽວກັບມີເດຍວິກິ": "NS_MEDIAWIKI_TALK", "ແມ່ແບບ": "NS_TEMPLATE", "ສົນທະນາກ່ຽວກັບແມ່ແບບ": "NS_TEMPLATE_TALK", "ຊ່ວຍເຫຼືອ": "NS_HELP", "ສົນທະນາກ່ຽວກັບຊ່ວຍເຫຼືອ": "NS_HELP_TALK", "ໝວດ": "NS_CATEGORY", "ສົນທະນາກ່ຽວກັບໝວດ": "NS_CATEGORY_TALK", } wiki_ns_re_lo = [ ("ສົນທະນາກ່ຽວກັບ", "", "NS_PROJECT_TALK"), ] wiki_ns_ht = { "Medya": "NS_MEDIA", "Espesyal": "NS_SPECIAL", "Diskite": "NS_TALK", "Itilizatè": "NS_USER", "Diskisyon_Itilizatè": "NS_USER_TALK", "Imaj": "NS_IMAGE", "Diskisyon_Imaj": "NS_IMAGE_TALK", "MedyaWiki": "NS_MEDIAWIKI", "Diskisyon_MedyaWiki": "NS_MEDIAWIKI_TALK", "Modèl": "NS_TEMPLATE", "Diskisyon_Modèl": "NS_TEMPLATE_TALK", "Èd": "NS_HELP", "Diskisyon_Èd": "NS_HELP_TALK", "Kategori": "NS_CATEGORY", "Diskisyon_Kategori": "NS_CATEGORY_TALK", } wiki_ns_re_ht = [ ("Diskisyon_", "", "NS_PROJECT_TALK"), ] wiki_ns_am = { "ፋይል": "NS_MEDIA", "ልዩ": "NS_SPECIAL", "ውይይት": "NS_TALK", "አባል": "NS_USER", "አባል_ውይይት": "NS_USER_TALK", "ስዕል": "NS_IMAGE", "ስዕል_ውይይት": "NS_IMAGE_TALK", "መልዕክት": "NS_MEDIAWIKI", "መልዕክት_ውይይት": "NS_MEDIAWIKI_TALK", "መልጠፊያ": "NS_TEMPLATE", "መልጠፊያ_ውይይት": "NS_TEMPLATE_TALK", "እርዳታ": "NS_HELP", "እርዳታ_ውይይት": "NS_HELP_TALK", "መደብ": "NS_CATEGORY", "መደብ_ውይይት": "NS_CATEGORY_TALK", } wiki_ns_re_am = [ ("", "_ውይይት", "NS_PROJECT_TALK"), ] wiki_ns_pms = { "Media": "NS_MEDIA", "Special": "NS_SPECIAL", "Discussion": "NS_TALK", "Utent": "NS_USER", "Ciaciarade": "NS_USER_TALK", "Figura": "NS_IMAGE", "Discussion_dla_figura": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "Discussion_dla_MediaWiki": "NS_MEDIAWIKI_TALK", "Stamp": "NS_TEMPLATE", "Discussion_dlë_stamp": "NS_TEMPLATE_TALK", "Agiut": "NS_HELP", "Discussion_ant_sl'agiut": "NS_HELP_TALK", "Categorìa": "NS_CATEGORY", "Discussion_ant_sla_categorìa": "NS_CATEGORY_TALK", } wiki_ns_re_pms = [ ("Discussion_ant_sla_", "", "NS_PROJECT_TALK"), ] wiki_ns_el = { "Μέσον": "NS_MEDIA", "Ειδικό": "NS_SPECIAL", "Συζήτηση": "NS_TALK", "Χρήστης": "NS_USER", "Συζήτηση_χρήστη": "NS_USER_TALK", "Εικόνα": "NS_IMAGE", "Συζήτηση_εικόνας": "NS_IMAGE_TALK", "MediaWiki": "NS_MEDIAWIKI", "MediaWiki_talk": "NS_MEDIAWIKI_TALK", "Πρότυπο": "NS_TEMPLATE", "Συζήτηση_προτύπου": "NS_TEMPLATE_TALK", "Βοήθεια": "NS_HELP", "Συζήτηση_βοήθειας": "NS_HELP_TALK", "Κατηγορία": "NS_CATEGORY", "Συζήτηση_κατηγορίας": "NS_CATEGORY_TALK", } wiki_ns_re_el = [ ("", "_συζήτηση", "NS_PROJECT_TALK"), ] wiki_ns = { "io": wiki_ns_io, "et": wiki_ns_et, "is": wiki_ns_is, "mr": wiki_ns_mr, "tyv": wiki_ns_tyv, "qu": wiki_ns_qu, "frp": wiki_ns_frp, "kab": wiki_ns_kab, "fo": wiki_ns_fo, "pt_br": wiki_ns_pt_br, "dsb": wiki_ns_dsb, "jv": wiki_ns_jv, "vo": wiki_ns_vo, "ka": wiki_ns_ka, "gn": wiki_ns_gn, "sr_el": wiki_ns_sr_el, "cs": wiki_ns_cs, "sc": wiki_ns_sc, "km": wiki_ns_km, "sk": wiki_ns_sk, "bpy": wiki_ns_bpy, "he": wiki_ns_he, "hi": wiki_ns_hi, "hu": wiki_ns_hu, "lt": wiki_ns_lt, "hy": wiki_ns_hy, "ps": wiki_ns_ps, "ksh": wiki_ns_ksh, "tr": wiki_ns_tr, "af": wiki_ns_af, "zh_hans": wiki_ns_zh_hans, "id": wiki_ns_id, "tet": wiki_ns_tet, "an": wiki_ns_an, "ar": wiki_ns_ar, "tg_cyrl": wiki_ns_tg_cyrl, "rmy": wiki_ns_rmy, "mk": wiki_ns_mk, "eu": wiki_ns_eu, "az": wiki_ns_az, "bat_smg": wiki_ns_bat_smg, "it": wiki_ns_it, "ms": wiki_ns_ms, "ba": wiki_ns_ba, "be": wiki_ns_be, "crh_cyrl": wiki_ns_crh_cyrl, "nn": wiki_ns_nn, "nv": wiki_ns_nv, "ru": wiki_ns_ru, "crh_latn": wiki_ns_crh_latn, "be_tarask": wiki_ns_be_tarask, "yue": wiki_ns_yue, "kn": wiki_ns_kn, "sl": wiki_ns_sl, "nds": wiki_ns_nds, "tlh": wiki_ns_tlh, "la": wiki_ns_la, "li": wiki_ns_li, "hr": wiki_ns_hr, "pl": wiki_ns_pl, "nds_nl": wiki_ns_nds_nl, "pt": wiki_ns_pt, "xal": wiki_ns_xal, "ast": wiki_ns_ast, "ia": wiki_ns_ia, "kk_arab": wiki_ns_kk_arab, "zh_hant": wiki_ns_zh_hant, "fur": wiki_ns_fur, "en": wiki_ns_en, "lbe": wiki_ns_lbe, "ml": wiki_ns_ml, "fiu_vro": wiki_ns_fiu_vro, "yi": wiki_ns_yi, "udm": wiki_ns_udm, "ur": wiki_ns_ur, "fa": wiki_ns_fa, "ku_latn": wiki_ns_ku_latn, "uz": wiki_ns_uz, "fi": wiki_ns_fi, "bn": wiki_ns_bn, "pnt": wiki_ns_pnt, "br": wiki_ns_br, "hsb": wiki_ns_hsb, "no": wiki_ns_no, "vi": wiki_ns_vi, "fy": wiki_ns_fy, "ca": wiki_ns_ca, "ce": wiki_ns_ce, "gl": wiki_ns_gl, "sa": wiki_ns_sa, "tt_latn": wiki_ns_tt_latn, "cu": wiki_ns_cu, "ko": wiki_ns_ko, "cy": wiki_ns_cy, "si": wiki_ns_si, "sq": wiki_ns_sq, "su": wiki_ns_su, "arz": wiki_ns_arz, "lb": wiki_ns_lb, "pa": wiki_ns_pa, "csb": wiki_ns_csb, "th": wiki_ns_th, "vec": wiki_ns_vec, "zea": wiki_ns_zea, "lv": wiki_ns_lv, "scn": wiki_ns_scn, "new": wiki_ns_new, "zh_tw": wiki_ns_zh_tw, "eo": wiki_ns_eo, "es": wiki_ns_es, "uk": wiki_ns_uk, "bg": wiki_ns_bg, "ja": wiki_ns_ja, "kaa": wiki_ns_kaa, "bcl": wiki_ns_bcl, "bs": wiki_ns_bs, "stq": wiki_ns_stq, "fr": wiki_ns_fr, "nl": wiki_ns_nl, "ro": wiki_ns_ro, "ga": wiki_ns_ga, "sr_ec": wiki_ns_sr_ec, "kk_cyrl": wiki_ns_kk_cyrl, "oc": wiki_ns_oc, "wa": wiki_ns_wa, "cv": wiki_ns_cv, "os": wiki_ns_os, "kk_latn": wiki_ns_kk_latn, "da": wiki_ns_da, "sv": wiki_ns_sv, "de": wiki_ns_de, "ta": wiki_ns_ta, "vls": wiki_ns_vls, "te": wiki_ns_te, "lo": wiki_ns_lo, "ht": wiki_ns_ht, "am": wiki_ns_am, "pms": wiki_ns_pms, "el": wiki_ns_el, } wiki_ns_re = { "io": wiki_ns_re_io, "et": wiki_ns_re_et, "is": wiki_ns_re_is, "mr": wiki_ns_re_mr, "tyv": wiki_ns_re_tyv, "qu": wiki_ns_re_qu, "frp": wiki_ns_re_frp, "kab": wiki_ns_re_kab, "fo": wiki_ns_re_fo, "pt_br": wiki_ns_re_pt_br, "dsb": wiki_ns_re_dsb, "jv": wiki_ns_re_jv, "vo": wiki_ns_re_vo, "ka": wiki_ns_re_ka, "gn": wiki_ns_re_gn, "sr_el": wiki_ns_re_sr_el, "cs": wiki_ns_re_cs, "sc": wiki_ns_re_sc, "km": wiki_ns_re_km, "sk": wiki_ns_re_sk, "bpy": wiki_ns_re_bpy, "he": wiki_ns_re_he, "hi": wiki_ns_re_hi, "hu": wiki_ns_re_hu, "lt": wiki_ns_re_lt, "hy": wiki_ns_re_hy, "ps": wiki_ns_re_ps, "ksh": wiki_ns_re_ksh, "tr": wiki_ns_re_tr, "af": wiki_ns_re_af, "zh_hans": wiki_ns_re_zh_hans, "id": wiki_ns_re_id, "tet": wiki_ns_re_tet, "an": wiki_ns_re_an, "ar": wiki_ns_re_ar, "tg_cyrl": wiki_ns_re_tg_cyrl, "rmy": wiki_ns_re_rmy, "mk": wiki_ns_re_mk, "eu": wiki_ns_re_eu, "az": wiki_ns_re_az, "bat_smg": wiki_ns_re_bat_smg, "it": wiki_ns_re_it, "ms": wiki_ns_re_ms, "ba": wiki_ns_re_ba, "be": wiki_ns_re_be, "crh_cyrl": wiki_ns_re_crh_cyrl, "nn": wiki_ns_re_nn, "nv": wiki_ns_re_nv, "ru": wiki_ns_re_ru, "crh_latn": wiki_ns_re_crh_latn, "be_tarask": wiki_ns_re_be_tarask, "yue": wiki_ns_re_yue, "kn": wiki_ns_re_kn, "sl": wiki_ns_re_sl, "nds": wiki_ns_re_nds, "tlh": wiki_ns_re_tlh, "la": wiki_ns_re_la, "li": wiki_ns_re_li, "hr": wiki_ns_re_hr, "pl": wiki_ns_re_pl, "nds_nl": wiki_ns_re_nds_nl, "pt": wiki_ns_re_pt, "xal": wiki_ns_re_xal, "ast": wiki_ns_re_ast, "ia": wiki_ns_re_ia, "kk_arab": wiki_ns_re_kk_arab, "zh_hant": wiki_ns_re_zh_hant, "fur": wiki_ns_re_fur, "en": wiki_ns_re_en, "lbe": wiki_ns_re_lbe, "ml": wiki_ns_re_ml, "fiu_vro": wiki_ns_re_fiu_vro, "yi": wiki_ns_re_yi, "udm": wiki_ns_re_udm, "ur": wiki_ns_re_ur, "fa": wiki_ns_re_fa, "ku_latn": wiki_ns_re_ku_latn, "uz": wiki_ns_re_uz, "fi": wiki_ns_re_fi, "bn": wiki_ns_re_bn, "pnt": wiki_ns_re_pnt, "br": wiki_ns_re_br, "hsb": wiki_ns_re_hsb, "no": wiki_ns_re_no, "vi": wiki_ns_re_vi, "fy": wiki_ns_re_fy, "ca": wiki_ns_re_ca, "ce": wiki_ns_re_ce, "gl": wiki_ns_re_gl, "sa": wiki_ns_re_sa, "tt_latn": wiki_ns_re_tt_latn, "cu": wiki_ns_re_cu, "ko": wiki_ns_re_ko, "cy": wiki_ns_re_cy, "si": wiki_ns_re_si, "sq": wiki_ns_re_sq, "su": wiki_ns_re_su, "arz": wiki_ns_re_arz, "lb": wiki_ns_re_lb, "pa": wiki_ns_re_pa, "csb": wiki_ns_re_csb, "th": wiki_ns_re_th, "vec": wiki_ns_re_vec, "zea": wiki_ns_re_zea, "lv": wiki_ns_re_lv, "scn": wiki_ns_re_scn, "new": wiki_ns_re_new, "zh_tw": wiki_ns_re_zh_tw, "eo": wiki_ns_re_eo, "es": wiki_ns_re_es, "uk": wiki_ns_re_uk, "bg": wiki_ns_re_bg, "ja": wiki_ns_re_ja, "kaa": wiki_ns_re_kaa, "bcl": wiki_ns_re_bcl, "bs": wiki_ns_re_bs, "stq": wiki_ns_re_stq, "fr": wiki_ns_re_fr, "nl": wiki_ns_re_nl, "ro": wiki_ns_re_ro, "ga": wiki_ns_re_ga, "sr_ec": wiki_ns_re_sr_ec, "kk_cyrl": wiki_ns_re_kk_cyrl, "oc": wiki_ns_re_oc, "wa": wiki_ns_re_wa, "cv": wiki_ns_re_cv, "os": wiki_ns_re_os, "kk_latn": wiki_ns_re_kk_latn, "da": wiki_ns_re_da, "sv": wiki_ns_re_sv, "de": wiki_ns_re_de, "ta": wiki_ns_re_ta, "vls": wiki_ns_re_vls, "te": wiki_ns_re_te, "lo": wiki_ns_re_lo, "ht": wiki_ns_re_ht, "am": wiki_ns_re_am, "pms": wiki_ns_re_pms, "el": wiki_ns_re_el, } wikitrans-1.3/wikitrans/wikitoken.py0000644000175000017500000002014013342563441017711 0ustar graygray00000000000000# Wiki tokens. -*- coding: utf-8 -*- # Copyright (C) 2015-2018 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . """ Wiki markup tokens and associated classes. This module defines classes for the basic nodes of the Wiki markup parse tree: WikiNode -- Abstract parse tree node. WikiContentNode -- A node associated with some content. WikiSeqNode -- A sequence of nodes. WikiTextNode -- Textual content. WikiDelimNode -- Delimiter. WikiTagNode -- Tag (e.g. , , , etc.) WikiRefNode -- Wiki reference (e.g. [target|name]) WikiHdrNode -- Heading (e.g. == Section ==) WikiEltNode -- Environment element. WikiEnvNode -- Environment (numbered or unnumbered list, definition, etc.) WikiIndNode -- Indent node. Auxiliary classes: WikiNodeEncoder -- Custom JSONEncoder subclass for serializing objects of the above classes. """ from __future__ import print_function import re import json class WikiNodeEncoder(json.JSONEncoder): """Custom JSONEncoder subclass for serializing WikiNode and its subclasses.""" def default(self, obj): if isinstance(obj, WikiNode): return obj.json_encode() return json.JSONEncoder.default(self, obj) def jsonencoder(func): def _mkencoder(self): json = func(self) json['wikinode'] = self.__class__.__name__ json['type'] = self.type return json return _mkencoder class WikiNode(object): """Generic parse tree node. Attributes: type -- actual type of this object (string) parser -- parser instance that owns this node """ type = 'UNDEF' parser = None def __init__(self, parser, **kwargs): self.parser = parser for key in kwargs: if hasattr(self, key): self.__dict__[key] = kwargs[key] else: raise AttributeError("'%s' has no attribute '%s'" % (self.__class__.__name__, key)) def __str__(self): return json.dumps(self, cls=WikiNodeEncoder, sort_keys=True) @jsonencoder def json_encode(self): ret = {} for x in dir(self): if x == 'parser' or x.startswith('_') or type(x) == 'function': continue if x in self.__dict__: ret[x] = self.__dict__[x] return ret def format(self): """Abstract formatting function. Derived classes must override it. """ pass class WikiContentNode(WikiNode): """Generic content node. Attributes: content -- Actual content """ content = None def format(self): pass @jsonencoder def json_encode(self): ret = {} if self.content: if self.type == 'TEXT': ret['content'] = self.content elif isinstance(self.content, list): ret['content'] = [x for x in map(lambda x: x.json_encode(), self.content)] elif isinstance(self.content, WikiNode): ret['content'] = self.content.json_encode() else: ret['content'] = self.content else: ret['content'] = None return ret class WikiSeqNode(WikiContentNode): """Generic sequence of nodes. Attributes: content -- list of nodes. """ def format(self): for x in self.content: x.format() @jsonencoder def json_encode(self): ret = {} if not self.content: ret['content'] = None elif isinstance(self.content, list): ret['content'] = [x for x in map(lambda x: x.json_encode(), self.content)] elif isinstance(self.content, WikiNode): ret['content'] = self.content.json_encode() else: ret['content'] = self.content return ret # ############## class WikiTextNode(WikiContentNode): """Text node. Attributes: type -- 'TEXT' content -- string """ type = 'TEXT' @jsonencoder def json_encode(self): return { 'content': self.content } class WikiDelimNode(WikiContentNode): """Delimiter node. Attributes: type -- 'DELIM' content -- actual delimiter string isblock -- boolean indicating whether it is a block delimiter continuation -- True if continuation is expected """ type = 'DELIM' isblock=False continuation = False class WikiTagNode(WikiContentNode): """A Wiki tag. Attributes: tag -- actual tag name (with '<', '>', and eventual '/' stripped) isblock -- True if this is a block tag args -- List of tag arguments idx -- If this is a "see also" reference, index of this ref in the list of references. FIXME: Perhaps this merits a subclass? """ tag = None isblock = False args = None idx = None def __init__(self, *args, **keywords): super(WikiTagNode, self).__init__(*args, **keywords) if (self.type == 'TAG' and self.tag == 'ref' and hasattr(self.parser, 'references')): self.idx = len(self.parser.references) self.parser.references.append(self) @jsonencoder def json_encode(self): return { 'tag': self.tag, 'isblock': self.isblock, 'args': self.args.tab if self.args else None, 'content': self.content.json_encode() if self.content else None, 'idx': self.idx } class WikiRefNode(WikiContentNode): """Reference node. This class represents a wiki reference, such as "[ref|content]". Attributes: ref -- actual reference content -- content string """ type = 'REF' ref = None @jsonencoder def json_encode(self): return { 'ref': self.ref, 'content': self.content.json_encode() } class WikiHdrNode(WikiContentNode): """A wiki markup header class. Attributes: level -- header level content -- header content (WikiNode subclass object) """ type = 'HDR' level = None @jsonencoder def json_encode(self): return { 'level': self.level, 'content': self.content.json_encode() } class WikiEltNode(WikiContentNode): """Environment element node. Attributes: subtype -- type of the environment (numbered, unnumbered, defn) content -- content of the element (WikiNode subclass object) """ type = 'ELT' subtype = None @jsonencoder def json_encode(self): return { 'subtype': self.subtype, 'content': self.content.json_encode() } class WikiEnvNode(WikiContentNode): """Wiki Environment Node Attributes: envtype -- type of the environment (numbered, unnumbered, defn) level -- nesting level of the environment """ type = 'ENV' envtype = None level = None @jsonencoder def json_encode(self): return { 'envtype': self.envtype, 'level': self.level, 'content': [x for x in map(lambda x: x.json_encode(), self.content)] } class WikiIndNode(WikiContentNode): """Indented block node. Attributes: level -- Indentation level. content -- Indented content (WikiNode subclass object). """ type = 'IND' level = None @jsonencoder def json_encode(self): return { 'level': self.level, 'content': self.content.json_encode() } wikitrans-1.3/wikitrans/wikidump.py0000644000175000017500000000414113340032704017530 0ustar graygray00000000000000# Wiki "dump" format. -*- coding: utf-8 -*- # Copyright (C) 2015-2018 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . """ Print Wiki parse tree as JSON. Classes: DumpWikiMarkup """ from __future__ import print_function from wikitrans.wikitoken import * import json from wikitrans.wikimarkup import WikiMarkup class DumpReferences(object): idx = 0 def __len__(self): return self.idx + 1 def append(self, obj): self.idx += 1 class DumpWikiMarkup(WikiMarkup): """Produce a JSON dump of the Wiki markup parse tree. Usage: x = DumpWikiMarkup(file="input.wiki") # Parse the input: x.parse() # Print a JSON dump of the parse tree print(str(x)) """ indent = None references = DumpReferences() def __init__(self, **kwarg): """Create a DumpWikiMarkup object. Arguments: filename=FILE Read Wiki material from the file named FILE. file=FD Read Wiki material from file object FD. text=STRING Read Wiki material from STRING. indent=N Basic indent offset for JSON objects. """ n = kwarg.pop('indent', None) if n != None: self.indent = int(n) super(DumpWikiMarkup, self).__init__(self, **kwarg) def __str__(self): return json.dumps(self.tree, cls=WikiNodeEncoder, indent=self.indent, separators=(',', ': '), sort_keys=True) wikitrans-1.3/tests/0000755000175000017500000000000013342564531014466 5ustar graygray00000000000000wikitrans-1.3/tests/__init__.py0000644000175000017500000000032213340032704016562 0ustar graygray00000000000000import unittest import sys from os.path import dirname, abspath sys.path.insert(0,dirname(abspath(__file__))) def wiki_test_suite(): loader = unittest.TestLoader() return loader.loadTestFromModule() wikitrans-1.3/tests/test_texi.py0000644000175000017500000000053513340032704017041 0ustar graygray00000000000000#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import unittest from wikitrans.wiki2texi import TexiWikiMarkup from wikitest import populate_methods class TestTexiWikiMarkup (unittest.TestCase): pass populate_methods(TestTexiWikiMarkup, TexiWikiMarkup, '.texi') if __name__ == '__main__': unittest.main() wikitrans-1.3/tests/test_text.py0000644000175000017500000000053513340032704017054 0ustar graygray00000000000000#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import unittest from wikitrans.wiki2text import TextWikiMarkup from wikitest import populate_methods class TestTextWikiMarkup (unittest.TestCase): pass populate_methods(TestTextWikiMarkup, TextWikiMarkup, '.text') if __name__ == '__main__': unittest.main() wikitrans-1.3/tests/wikitest.py0000644000175000017500000000210213340032704016664 0ustar graygray00000000000000#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function from glob import glob import os.path def wiki_markup_test(classname, name_in, name_out): fh = open(name_out) buf = ''.join(fh.readlines()).strip() fh.close() hwm = classname(filename=name_in, lang="en") hwm.parse() if str(hwm).strip() == buf: return True # fail print("\n>>>%s<<<" % buf) print(">>>%s<<<" % str(hwm).strip()) return False def populate_methods(cls, wcls, suffix): def settest(self, base, wiki_name, pat_name): def dyntest(self): self.assertTrue(wiki_markup_test(wcls, wiki_name, pat_name)) meth = 'test_' + wcls.__name__ + '_' + base dyntest.__name__ = meth setattr(cls, meth, dyntest) for file in glob('testdata/*.wiki'): if os.path.isfile(file): patfile = file[:len(file) - 5] + suffix base, ext = os.path.splitext(os.path.basename(file)) if os.path.exists(patfile) and os.path.isfile(patfile): settest(cls, base, file, patfile) wikitrans-1.3/tests/test_html.py0000644000175000017500000000052513340032704017033 0ustar graygray00000000000000#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import unittest from wikitrans.wiki2html import HtmlWikiMarkup from wikitest import populate_methods class TestWikiMarkup (unittest.TestCase): pass populate_methods(TestWikiMarkup, HtmlWikiMarkup, '.html') if __name__ == '__main__': unittest.main() wikitrans-1.3/COPYING.txt0000644000175000017500000010437413340032704015174 0ustar graygray00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . wikitrans-1.3/CHANGES.txt0000644000175000017500000000036613342564414015142 0ustar graygray00000000000000v1.3, 2018-09-01 -- Don't throw exception on invalid tokens. Fix python 3 compatibility v1.2, 2018-08-27 -- Fix handling of unrecognized closing tags. v1.1, 2018-08-24 -- Initialize token_class dynamically. v1.0, 2018-08-19 -- Initial release. wikitrans-1.3/README.rst0000644000175000017500000001346113342560623015016 0ustar graygray00000000000000MediaWiki Markup Translator =========================== This package provides Python framework for translating WikiMedia articles to various formats. The present version supports conversions to plain text, HTML, and Texinfo formats. A command line converter utility is included. Classes ======= class ``WikiMarkup`` -------------------- A base class for all translator classes. Unless you plan extending wikitrans, you will never have to create objects of this class. Instead, you will be using one of its derived classes. Constructor arguments common for all derived classes: filename = *name* The file *name* is opened and used for input. file = *fd* An already opened file *fd* is used for input. text = *string* Input is taken from *string*, line by line. lang = *code* Specifies language version. Default is ``en``. This variable can be referred to as ``%(lang)s`` in the keyword arguments below. html_base = *url* Base URL for cross-references. Default is ``http://%(lang)s.wikipedia.org/wiki/``. image_base = *url* Base URL for images. Default is ``http://upload.wikimedia.org/wikipedia/commons/thumb/a/bf`` media_base = *url* Base URL for media files. Default is ``http://www.mediawiki.org/xml/export-0.3`` debug_level = *int* Debug verbosity level (0 - no debug info, 100 - excessively copious debug messages). Default is 0. strict = *bool* Strict parsing mode. Throw exceptions on syntax errors. Default is False. class ``TextWikiMarkup`` ------------------------ Translates material in Wiki markup language to plain text. Usage:: from WikiTrans.wiki2text import TextWikiMarkup markup = TextWikiMarkup(filename='input.txt') markup.parse() print(str(markup)) Specific constructor arguments: width = *N* Limit output width to *N* columns. Default is 78. show_urls = *bool* Whether or not to show the URLs links refer to. If *bool* is ``True`` (the default), a URL will be displayed in parentheses next to the link text. If ``False``, only the link text will be displayed. class ``TextWiktionaryMarkup`` ------------------------------ Translate material from wiktionary to plain text form. This is supposed to provide a wiktionary-specific form of ``TextWikiMarkup``. Currently, this class differs from ``TextWikiMarkup`` only in that the default value for ``html_base`` is ``http://%(lang)s.wikipedia.org/wiki/``. class ``TexiWikiMarkup`` ------------------------ Translate Wiki markup to Texinfo source. Usage:: from WikiTrans.wiki2texi import TexiWikiMarkup markup = TexiWikiMarkup(filename='input.txt') markup.parse() print(str(markup)) Two markup-specific keywords control the sectioning model used. sectioning_model = *model* Selects the Texinfo sectioning model for the output document. Possible values are: ``numbered`` Top of document is marked with ``@top``. Headings (``=``, ``==``, ``===``, etc) produce ``@chapter``, ``@section``, ``@subsection``, etc. ``unnumbered`` Unnumbered sectioning: ``@top``, ``@unnumbered``, ``@unnumberedsec``, ``@unnumberedsubsec``. ``appendix`` Sectioning suitable for appendix entries: ``@top``, ``@appendix``, ``@appendixsec``, ``@appendixsubsec``, etc. ``heading`` Use heading directives to reflect sectioning: ``@majorheading``, ``@chapheading``, ``@heading``, ``@subheading``, etc. sectioning_start = *n* Shift resulting heading level by *n* positions. For example, supposing ``sectioning_model=numbered``, ``== A ==`` will produce ``@section A`` on output. If ``sectioning_start=1`` is also given, this directive will produce ``@subsection A`` instead. class ``HtmlWikiMarkup`` ------------------------ Translates Wiki markup to HTML. Usage:: from WikiTrans.wiki2html import HtmlWikiMarkup markup = HtmlWikiMarkup(filename='input.txt') markup.parse() print(str(markup)) Supported keywords are same as for ``WikiMarkup`` class. class ``HtmlWiktionaryMarkup`` ------------------------------ Translate material from wiktionary to HTML form. This is supposed to provide a wiktionary-specific form of ``HtmlWikiMarkup``. Currently both classes are equivalent, except that the default value for ``html_base`` in ``HtmlWiktionaryMarkup`` is ``http://%(lang)s.wikipedia.org/wiki/``. The ``wikitrans`` utility ========================= This command line utility converts the supplied text to selected output format. The usage syntax is:: wikitrans [OPTIONS] ARG If ARG looks like a URL, the wiki text to be converted will be downloaded from that URL. Otherwise, if the ``--base-url=URL`` option is given, ARG is treated as the name of the page to get from the WikiMedia istallation at ``URL``. Otherwise, ARG is treated as the name of the file to read wiki material from. Examples:: wikitrans text.wiki wikitrans --base-url http://en.wiktionary.org door wikitrans https://en.wiktionary.org/wiki/Special:Export/door Options are: ``--version`` Show program's version number and exit. ``-h``, ``--help`` Show a short usage summary and exit. ``-v``, ``--verbose`` Verbose operation. ``-I ITYPE``, ``--input-type=ITYPE`` Set input document type. *ITYPE* is one of: ``default`` or ``wiktionary``. ``-t OTYPE``, ``--to=OTYPE``, ``--type=OTYPE`` Set output document type (``html`` (the default), ``texi``, ``text``, or ``dump``). ``-l LANG``, ``--lang=LANG`` Set input document language. ``-o KW=VAL``, ``--option=KW=VAL`` Pass the keyword argument ``KW=VAL`` to the parser class constructor. ``-d DEBUG``, ``--debug=DEBUG`` Set debug level (0..100). ``-D``, ``--dump`` Dump parse tree and exit; same as ``--type=dump``. ``-b URL``, ``--base-url=URL`` Set base url. Note: when using ``--base-url`` or passing URL as an argument (2nd and 3rd use cases above), if the URL is in 'wikipedia.org' or 'wiktionary.org' domain, the options ``--input-type``, and ``--lang`` are set automatically. wikitrans-1.3/setup.cfg0000644000175000017500000000004613342564531015145 0ustar graygray00000000000000[egg_info] tag_build = tag_date = 0