Page MenuHomePhabricator

solve_disambiguation.py does not work for links containing a namespace
Closed, ResolvedPublic

Description

Try the following example:

C:\pwb\GIT\core>pwb.py solve_disambiguation -just -pos:"Wikipedista:Martin Urban
ec/Pískoviště/3" "Wikipedista:Martin Urbanec/Pískoviště/1" -lang:cs -simulate

you'll get

Alternatives for [[cs:Wikipedista]]

  1 - Wikipedie
  2 - Wikipedista:Martin Urbanec/Pískoviště/3

Found 20 references.
Will work on 20 pages.
Retrieving 20 pages from wikipedia:cs.


>>> Wikipedista:Lt.Col <<<
'''Lt.Col''' je '''[[Wikipedista]]''' z města '''[[Moravský Krumlov]]'''.Pod zkr
atkou '''Lt.Co
Option (<number> [1-2], r<number> [1-2], [s]kip link, [e]dit page, [n]ext page,
[u]nlink, [m]ore context, show [d]isambiguation page, [l]ist, [a]dd new, [q]uit)
:

which means it search for references of the page [[Wikipedista]] instead of Wikipedista:Martin Urbanec/Pískoviště/1.

A similar sample:

C:\pwb\GIT\core>pwb.py solve_disambiguation -just -pos:"Wikipedista:Martin Urban
ec/Pískoviště/3" "User:Martin Urbanec/Pískoviště/1" -lang:cs

Alternatives for [[cs:User]]

  1 - Wikipedista:Martin Urbanec/Pískoviště/3

Found 1 references.
Will work on 1 pages.
Retrieving 1 pages from wikipedia:cs.


>>> Diskuse s wikipedistou:Ludek <<<
4.162.106.90]] 19:00, 18. 12. 2007 (UTC) ( = "Kaffeekanne)
 [[user|kaffeekanne]]

== Smazaný externí odkaz - bohemština ==

Citace: "rv, zní
Option (<number> [1], r<number> [1], [s]kip link, [e]dit page, [n]ext page, [u]n
link, [m]ore context, show [d]isambiguation page, [l]ist, [a]dd new, [q]uit):

The page is [[User]] here.

Event Timeline

Xqt triaged this task as High priority.Jan 13 2017, 10:40 AM
Xqt added a subscriber: jayvdb.

This bug is caused by the implicit positional_arg_name handling of the pagegenerators.GeneratorFactory

The command line with explicit -page option works as expected:

C:\pwb\GIT\core>pwb.py solve_disambiguation -just -pos:"Wikipedista:Martin Urbanec/Pískoviště/3" -page:"Wikipedista:Martin Urbanec/Pískoviště/1" -lang:cs -simulate

Change 331965 had a related patch set uploaded (by Xqt):
[bugfix] Fix for positional_arg behavior of GeneratorFactory

https://gerrit.wikimedia.org/r/331965

Xqt renamed this task from solve_disambiguation.py does not work for links containing a namespace or a subpages to solve_disambiguation.py does not work for links containing a namespace.Jan 13 2017, 11:17 AM

Change 331965 merged by jenkins-bot:
[bugfix] Fix for positional_arg behavior of GeneratorFactory

https://gerrit.wikimedia.org/r/331965