Comments (8)
I tried to troubleshoot and part of the problem is that the french templates are localized like this
Modèle:
instead of
Template:
"Template:" is hardcoded in the python script. When I fix this, the templating works. However, there are still issues with Lua modules.
Example : Modèle:lang points to Modèle:Langue that uses Module:Langue !
And this requires lua support. So I guess the pass to collect templates also needs to collect the Lua modules ...
from wikiextractor.
The problem is related to that. When loading previously saved templates, it assumes that the template namespace is 'Template'.
I am working on a fix.
from wikiextractor.
It is fixed in release 2.35.
from wikiextractor.
Thank you for the quick fix. There are other issues though. At least one of them is related to the original description. For some reason, the #redirect are lower case in french while the regex is upper case.
check for redirects
m = re.match('#REDIRECT._?[[([^]]_)]]', page[0], re.IGNORECASE)
if m:
redirects[title] = m.group(1) #normalizeTitle(m.group(1))
return
or even like this
check for redirects
m = re.match('#(REDIRECT|redirect)._?[[([^]]_)]]', page[0], re.IGNORECASE)
if m:
redirects[title] = m.group(2) #normalizeTitle(m.group(2))
return
from wikiextractor.
After fixing an issue at line 478, I get :
L'aïkibudo (合気武道, #redirect ) est un art martial traditionnel d'origine japonaise ("budō") essentiellement basé sur des techniques de défense.
from wikiextractor.
Got it, thank you.
from wikiextractor.
After fixing
m = re.match('#(REDIRECT|redirect).?[[([^]])]]', page[0], re.IGNORECASE)
L'aïkibudo (合気武道, ) est un art martial traditionnel d'origine japonaise ("budō") essentiellement basé sur des techniques de défense.
But now, there is a missing japanese transliteration :
{"expandtemplates":{"wikitext":"'''a\u00efkibudo'''<span style="font-weight: normal"> (<span class="lang-ja" lang="ja" xml:lang="ja" title="Japonais">\u5408\u6c17\u6b66\u9053, <span class="t_nihongo_romaji" title="Transcription Hepburn"><span class="lang-ja-latn-alalc97" lang="ja-latn-alalc97">aikibud\u014d<span class="t_nihongo_help"><span class="t_nihongo_icon" style="color:#00e;font:bold 80% sans-serif;text-decoration:none;padding:0 .1em;">[[Aide:Japonais|?]])"}}
The missing part comes from a lua module :
DEBUG: INVOCATION 0 japonais|'''aïkibudo'''|合気武道|aikibudō
DEBUG: TITLE japonais
DEBUG: INVOCATION 1 #if:aikibudō
|, {{lang|ja-Latn-alalc97|aikibudō}}
|, '''aïkibudo'''
DEBUG: TITLE #if:aikibudō
DEBUG: INVOCATION 1 lang|ja-Latn-alalc97|aikibudō
DEBUG: TITLE lang
DEBUG: INVOCATION 2 #invoke:Langue|langue
DEBUG: TITLE #invoke:Langue
see :
https://fr.wikipedia.org/wiki/Module:Langue
Hence the need to extract the modules in the way as the templates and evaluate them using lua
(lua binaries are required to decode wikipedia, nice russian doll !)
from wikiextractor.
I know, the extensions are written in lua and you will have to access to the code of those extensions.
from wikiextractor.
Related Issues (20)
- How to extract lists pages?
- Option to remove blank pages? HOT 1
- Issues on newer (2023) and older (2019) dumps
- ptwiki-latest error HOT 2
- wikiextractor 3.0.6 not extracting HOT 3
- Why was --keep_tables removed?
- Never finishes and even debug gets stuck in a loop
- Warning: Template Errors HOT 1
- Is Windows supported
- Is Windows 10 supported? HOT 28
- Template errors in article HOT 2
- Add feature to extractPage to also dump the extracted page to json/csv/txt
- [Request for Help] Should I support a template file like `templates.txt` followed the arg `--templates`?
- Bullet points are missing in the final extracted text
- does not extract all wiki
- Parsing seems to exclude some part of the page
- Wikidata Extraction
- How to store a document in a separate txt file instead of a single txt file containing multiple documents
- ValueError: cannot find context for 'fork' & cannot pickle '_io.TextIOWrapper' object HOT 2
- pypi not updated with latest version (3.0.7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wikiextractor.