is it possible to remove contents from a ParsedPage and retrieve the (modified) wiki formatted text again?

37 views
Skip to first unread message

cbehrenberg

unread,
May 18, 2012, 1:33:28 PM5/18/12
to jwpl-users
Hi there!

I am going to parse some wiki formatted text from the (german)
Wiktionary project. JWPL seems to be a powerful tool for my
objectives. I already was able to push wiki formatted text into a
MediaWikiParser and now I have two rather simple technical questions:

1) How can I remove contents from a ParsedPage? (I want to e.g. throw
away sections)
2) Is it possible to retrieve back wiki formatted text from a
(modified) ParsedPage?

Example:

I want to extract certain information for the word "German". In
English, it means the language, in German it means a certain chemical
compound (see: http://de.wiktionary.org/wiki/German) - and in this
case I want to extract only the information from the section about the
German meaning. As part of my extraction process, I would like take
the wiki formatted text from my database and throw away the wiki
formatted text of the second section and save the "cleaned" wiki
formatted text in a new database, which serves as source for the next
step of my process.

Do you think JWPL is suitable, and if not, do you have any other
recommendations?

Thanks in advance,
-Christian

Torsten Zesch

unread,
May 22, 2012, 12:04:09 PM5/22/12
to jw...@googlegroups.com
Yes, it is possible to modify a ParsedPage using the setters.
However, it is not possible to get MediaWiki back from the internal
representation (that was never implemented).

I think that the Sweble parser can do that.
We are currently working on an integration which is supposed to be a
lot more robust than the old parser.
You can already use the parser with JWPL independently. Other users
have already reported on successfully doing that.

-Torsten

2012/5/18 cbehrenberg <chri...@behrenberg.de>:
Reply all
Reply to author
Forward
0 new messages