Skip to content

Store each article in exactly one file as plain text format#141

Open
ncarkaci wants to merge 2 commits into
WikiExtractor:masterfrom
ncarkaci:master
Open

Store each article in exactly one file as plain text format#141
ncarkaci wants to merge 2 commits into
WikiExtractor:masterfrom
ncarkaci:master

Conversation

@ncarkaci

@ncarkaci ncarkaci commented Sep 13, 2017

Copy link
Copy Markdown

Use file parameter and store each article in exactly one file as plain text format. This means that there no entities and frequent other HTML tags in file. The files are grouped by their first letter and stored in directory which named as the files first letter.

Fixed #139

@markdimi

Copy link
Copy Markdown

Is this feature merged with the master?

@ncarkaci

Copy link
Copy Markdown
Author

No, wait still in pull request status

@markdimi

markdimi commented Nov 15, 2017 via email

Copy link
Copy Markdown

@ncarkaci

Copy link
Copy Markdown
Author

Thanks! I used base branch code to remove html tags. My contribution includes that store each file into per file and group them into directory as a first letter. I test the code in non-english version of wiki (turkish). It's pass the test.

@ncarkaci ncarkaci changed the title Store each article in exactly one file Fixed : Store each article in exactly one file Nov 19, 2017
@markdimi

markdimi commented Nov 20, 2017 via email

Copy link
Copy Markdown

@markdimi

markdimi commented Nov 21, 2017 via email

Copy link
Copy Markdown

@PanderMusubi

Copy link
Copy Markdown

@attardi or other maintainers, please, merge this PR to get this bug fixed and with that revive WikiExtractor development. There are a lot of forks with good improvements because of the value of WikiExtractor. If they are never merged these additions unfortunately don't find their way to the normal end-user.

@ncarkaci

ncarkaci commented Jul 4, 2019

Copy link
Copy Markdown
Author

The conflicts were resolved

@ncarkaci ncarkaci changed the title Fixed : Store each article in exactly one file Store each article in exactly one file Sep 3, 2019
@ncarkaci ncarkaci changed the title Store each article in exactly one file Store each article in exactly one file as plain text format Sep 3, 2019
@HjalmarrSv

Copy link
Copy Markdown

I did something similar for cirrus-extract.py that uses the already template expanded cirrus dumps. With their ups (complete) and downs (no cfhoices regarding content).

@bluelephant825

bluelephant825 commented Oct 13, 2021

Copy link
Copy Markdown

@ncarkaci would you mind updating your code (33 commits behind attardi:master). It no longer works, at least for Python 3+. To start with, lines 77 and 78 should be commented out for Python 3+ as Python 3 has no sys.setdefaultencoding() function. It cannot be reinstated by reload(sys) like it can on Python 2 (which you really shouldn't do in any case).
Since the default on Python 3 is UTF-8 already, there is no point in leaving those statements in.

Furthermore, the results produced are empty text files. Your write function is expecting a string and receives bytes instead!

Screenshot 2021-10-13 at 21 16 50

This gets fixed by removing or commenting out line 603 which reads:
line = line.encode('utf-8')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support one document per output file and plain text output

5 participants