eranroz / hewiki-ReplaceBot

Replace bot for Hebrew Wikipedia
2 stars 4 forks source link

ReplaceBot on urwiki #4

Closed yethrosh closed 6 years ago

yethrosh commented 6 years ago

I configured this heReplaceBot for urdu wikipedia. But it works only when replacementPage has two or three entries, otherwise it does not work. You can look at its forked repository here: https://github.com/yethrosh/hewiki-ReplaceBot

And replacementPage is here: https://ur.m.wikipedia.org/wiki/ویکیپیڈیا:متداول_املائی_غلطیوں_کی_فہرستیں/برائے_خودکار_درستی

eranroz commented 6 years ago

This is good start and sorry for not documented it properly. Keep in mind that the columns meaning is: ID || Replace from || Replace to || Except || Link to discussion In the page you just linked there are no IDs>50 and aren't following the convetion the bot expects: https://github.com/eranroz/hewiki-ReplaceBot/blob/master/hewikiReplacebot.py#L117

yethrosh commented 6 years ago

Could you please edit one row on linked page according the bot expected convention, so that the thing will be more clear to me, thanks. :)

yethrosh commented 6 years ago

I am testing bot on sandbox of urdu wikipedia which is located here: https://ur.m.wikipedia.org/wiki/ویکیپیڈیا:تختہ_مشق

eranroz commented 6 years ago

See example here: https://ur.wikipedia.org/w/index.php?title=%D9%88%DB%8C%DA%A9%DB%8C%D9%BE%DB%8C%DA%88%DB%8C%D8%A7:%D9%85%D8%AA%D8%AF%D8%A7%D9%88%D9%84_%D8%A7%D9%85%D9%84%D8%A7%D8%A6%DB%8C_%D8%BA%D9%84%D8%B7%DB%8C%D9%88%DA%BA_%DA%A9%DB%8C_%D9%81%DB%81%D8%B1%D8%B3%D8%AA%DB%8C%DA%BA/%D8%A8%D8%B1%D8%A7%D8%A6%DB%92_%D8%AE%D9%88%D8%AF%DA%A9%D8%A7%D8%B1_%D8%AF%D8%B1%D8%B3%D8%AA%DB%8C&diff=3021526&oldid=3020951

Other rows need fix too. For security reasons, you (or someone else from the whitelist users in the config) must be the last editor of the page.

yethrosh commented 6 years ago

You mean that when ID column has number on every row then bot will work properly? Thanks. I will do that. :)

yethrosh commented 6 years ago

Now look at that page where ID column has number on every row but bot still do not replace here: https://ur.wikipedia.org/wiki/ویکیپیڈیا:تختہ_مشق

yethrosh commented 6 years ago

Any suggestion or solution please? :) We really need it.

eranroz commented 6 years ago
  1. Can you try it on a page with real content (e.g that has some words before/after word to be replaced). This is for sanity check that it doesn't look for safe prefix beforewise
  2. If it doesn't work you can add debug prints in fillReplementsDict to verify the dictionary is getting filled correctly
yethrosh commented 6 years ago
  1. I tried it on this page but made no replacement.
  2. I am not python programmer, could you please provide debugg printing function code?
yethrosh commented 6 years ago

Still waiting..... :)

eranroz commented 6 years ago

The issue is due to tailing spaces which are not expected after the nowiki. (this is important because one may want to intentionally add space as part of the replacement) Fixed here: https://ur.wikipedia.org/w/index.php?title=%D9%88%DB%8C%DA%A9%DB%8C%D9%BE%DB%8C%DA%88%DB%8C%D8%A7:%D9%85%D8%AA%D8%AF%D8%A7%D9%88%D9%84_%D8%A7%D9%85%D9%84%D8%A7%D8%A6%DB%8C_%D8%BA%D9%84%D8%B7%DB%8C%D9%88%DA%BA_%DA%A9%DB%8C_%D9%81%DB%81%D8%B1%D8%B3%D8%AA%DB%8C%DA%BA/%D8%A8%D8%B1%D8%A7%D8%A6%DB%92_%D8%AE%D9%88%D8%AF%DA%A9%D8%A7%D8%B1_%D8%AF%D8%B1%D8%B3%D8%AA%DB%8C&diff=3104502&oldid=3061140

yethrosh commented 6 years ago

Yeah! Now it works fine, Thanks. :)