词条 | Sweble |
释义 |
}}{{Infobox software | name = Sweble | logo = | screenshot = | caption = | author = OSR Group | developer = | released = {{Start date and age|2011|5|1}}[1] | latest release version = 2.0 | latest release date = {{Start date and age|2014|9|14}}[2] | programming language = Java | operating system = Cross-platform | platform = | language = | genre = Parser | license =Apache License | website = {{URL|sweble.org}} }} The Sweble Wikitext parser[3] is an open-source tool to parse the Wikitext markup language used by MediaWiki, the software behind Wikipedia. The initial development was done by Hannes Dohrn as a Ph.D. thesis project at the Open Source Research Group of professor Dirk Riehle at the University of Erlangen-Nuremberg from 2009 until 2011. The results were presented to the public for the first time at the WikiSym conference in 2011.[4] Before that, the dissertation[5] was inspected and approved by an independent scientific peer-review and was published at ACM Press. Based on the statistics at Ohloh[6] the parser is mainly written in the Java programming language. It was open-sourced in May 2011.[1] The parser itself is generated from a parsing expression grammar (PEG) using the Rats! parser generator. The encoding validation is done using a flex lexical analyser written in JFlex. A preprint version of the paper on the design of the Sweble Wikitext Parser can be found at the projects homepage.[7] In addition to that, a summary page exists at the MediaWiki's futures.[8] The current state of parsingThe parser used in MediaWiki converts the content directly from Wikitext into HTML. This process is done in two stages:[9]
As the authors of Sweble write in their paper,[7] an analysis of the source code of MediaWiki's parser showed that the strategy of using separate transformation steps leads to new problems: Most of the used functions do not take the scope of the surrounding elements into account. This consequently leads to wrong nesting in the resulting HTML output. As a result, the evaluation and rendering of the latter can be ambiguous and depends on the rendering engine of the used web browser. They state: "The individual processing steps often lead to unexpected and inconsistent behavior of the parser. For example, lists are recognized inside table cells. However, if the table itself appears inside a framed image, lists are not recognized."[7] As argued on the WikiSym conference in 2008, a lack of language precision and component decoupling hinders evolution of wiki software. If the wiki content had a well-specified representation that is fully machine processable, this would not only lead to better accessibility of its content but also improve and extend the ways in which it can be processed.[10] In addition, a well-defined object model for wiki content would allow further tools to operate on it. Until now there have been numerous attempts at implementing a new parser for MediaWiki (see ). None of them has succeeded so far. The authors of Sweble state that this might be "due to their choice of grammar, namely the well-known LALR(1) and LL(k) grammars. While these grammars are only a subset of context-free grammars, Wikitext requires global parser state and can therefore be considered a context-sensitive language."[7] As a result, they base their parser on a parsing expression grammar (PEG). How Sweble worksSweble parses the Wikitext and produces an abstract syntax tree as output. This helps to avoid errors from incorrect markup code (e.g. having a link spanning over multiple cells of a table). A detailed description of the abstract syntax tree model can be found in a technical report about the Wikitext Object Model (WOM).[11] Steps of parsingThe parser processes Wikitext in five stages:[7]
References1. ^1 announcement of the first public release of Sweble 2. ^Sweble 2.0 released! 3. ^Homepage of the Sweble project 4. ^Announcement at WikiSym conference website 5. ^{{cite journal|last=Dohrn|first=Hannes|author2=Riehle, Dirk |title=Design and Implementation of the Sweble Wikitext Parser: Unlocking the Structured Data of Wikipedia.|journal=Proceedings of the 7th International Symposium on Wikis and Open Collaboration (WikiSym 2011)|year=2011|pages=72–81|doi=10.1145/2038558.2038571|publisher=ACM}} 6. ^Ohloh page of the Sweble project 7. ^1 2 3 4 paper on the design of the Sweble Wikitext Parser 8. ^Future page for Sweble at MediaWiki 9. ^1 Markup Spec - MediaWiki 10. ^{{cite journal|last=Junghans|first=Martin|author2=Riehle, Dirk |author3=Gurram, Rama |author4=Lopes, Mário |author5= Yalcinalp, Umit |title=A grammar for standardized wiki markup|journal=Proceedings of the 4th International Symposium on Wikis (WikiSym'08)|year=2008|pages=21:1–21:8|doi=10.1145/1822258.1822287}} 11. ^{{cite journal|last=Dohrn|first=Hannes|author2=Riehle, Dirk |title=WOM: An Object Model for Wikitext|publisher=University of Erlangen|journal=Technical Report CS-2011-05 (July 2011)|date=July 2011}} 4 : Parsing|MediaWiki|Compiling tools|Unix programming tools |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。