{"action":"created","issue":{"url":"https://api.github.com/repos/seatgeek/fuzzywuzzy/issues/141","repository_url":"https://api.github.com/repos/seatgeek/fuzzywuzzy","labels_url":"https://api.github.com/repos/seatgeek/fuzzywuzzy/issues/141/labels{/name}","comments_url":"https://api.github.com/repos/seatgeek/fuzzywuzzy/issues/141/comments","events_url":"https://api.github.com/repos/seatgeek/fuzzywuzzy/issues/141/events","html_url":"https://github.com/seatgeek/fuzzywuzzy/issues/141","id":183151851,"number":141,"title":"Strange results that depends on sort and case","user":{"login":"Sovetnikov","id":9721773,"avatar_url":"https://avatars.githubusercontent.com/u/9721773?v=3","gravatar_id":"","url":"https://api.github.com/users/Sovetnikov","html_url":"https://github.com/Sovetnikov","followers_url":"https://api.github.com/users/Sovetnikov/followers","following_url":"https://api.github.com/users/Sovetnikov/following{/other_user}","gists_url":"https://api.github.com/users/Sovetnikov/gists{/gist_id}","starred_url":"https://api.github.com/users/Sovetnikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sovetnikov/subscriptions","organizations_url":"https://api.github.com/users/Sovetnikov/orgs","repos_url":"https://api.github.com/users/Sovetnikov/repos","events_url":"https://api.github.com/users/Sovetnikov/events{/privacy}","received_events_url":"https://api.github.com/users/Sovetnikov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-10-14T21:13:50Z","updated_at":"2016-11-01T19:29:42Z","closed_at":null,"body":"This is sample code:\n\n```\nfrom fuzzywuzzy import process\nfrom fuzzywuzzy.fuzz import partial_ratio\n\ndata = [\"Dom na Prishvina\", \"Krylatskij\",\n        \"Prigorod.Lesnoe\", \"Kotel'nicheskie vysotki\",\n        \"Novaja Presnja\", \"Stolichnyj\", \"Bukinist\",\n        \"Voznesenskij\", \"Oranzhvud\",\n        \"Akadem-Palas\", \"Novoe Tushino\",\n        \"Alekseevskaja roscha\", \"Marshal Grad\",\n        \"Novomolokovo\", \"Ljubertsy 2017\",\n        \"Malaja Ordynka 19\",\n        \"Rezidentsija na Vsevolozhskom\",\n        \"Kashintsevo\", \"Sojuznyj\",\n        \"Michurino-Zapad\",\n        \"Tat'janin Park\",\n        \"Peredelkino Blizhnee\",\n        \"Rozhdestvenskij\",\n        \"Vostochnoe Butovo\",\n        \"Nemchinovka-rezidents\",\n        \"LIFE-Mitinskaja ECOPARK\",\n        \"Nagornaja 7\", \"TehnoPark\",\n        \"Tarasovskaja, 2\",\n        \"Dom na VDNH\", \"Polet\",\n        \"VLjublino\", \"Letchika Babushkina 17\",\n        \"Dacha Shatena\", \"Versis\",\n        \"AFI Residence Paveletskaya\", \"Tarasovskaja, 25\", ]\n\nprint('1 %s' % process.extractBests('AFI', data))\nprint('2 %s' % process.extractBests('AFI', data, scorer=partial_ratio))\nprint('3 %s' % process.extractBests('afi', data, scorer=partial_ratio))\nprint('4 %s' % process.extractBests('afi', sorted(data)))\n\n```\n\nCode output is:\n\n```\n1 [(\"Tat'janin Park\", 60), ('AFI Residence Paveletskaya', 60), ('Krylatskij', 31), ('Dom na Prishvina', 30), ('Prigorod.Lesnoe', 30)]\n2 [('Dom na Prishvina', 0), ('Krylatskij', 0), ('Prigorod.Lesnoe', 0), (\"Kotel'nicheskie vysotki\", 0), ('Novaja Presnja', 0)]\n3 [('AFI Residence Paveletskaya', 100), (\"Tat'janin Park\", 67), ('Dom na Prishvina', 33), ('Krylatskij', 33), ('Prigorod.Lesnoe', 33)]\n4 [('AFI Residence Paveletskaya', 60), (\"Tat'janin Park\", 60), ('Krylatskij', 31), ('Akadem-Palas', 30), ('Alekseevskaja roscha', 30)]\n```\n1. Strange to me that process.extractBests('AFI', data) makes no difference between (\"Tat'janin Park\", 60), ('AFI Residence Paveletskaya', 60)\n2. Strange that process.extractBests('AFI', data, scorer=partial_ratio) does not find \"AFI Residence Paveletskaya\".\n3. Very strange that process.extractBests('afi', data, scorer=partial_ratio)) finds \"AFI Residence Paveletskaya\"!\n"},"comment":{"url":"https://api.github.com/repos/seatgeek/fuzzywuzzy/issues/comments/257668813","html_url":"https://github.com/seatgeek/fuzzywuzzy/issues/141#issuecomment-257668813","issue_url":"https://api.github.com/repos/seatgeek/fuzzywuzzy/issues/141","id":257668813,"user":{"login":"DavidCEllis","id":15880420,"avatar_url":"https://avatars.githubusercontent.com/u/15880420?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidCEllis","html_url":"https://github.com/DavidCEllis","followers_url":"https://api.github.com/users/DavidCEllis/followers","following_url":"https://api.github.com/users/DavidCEllis/following{/other_user}","gists_url":"https://api.github.com/users/DavidCEllis/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidCEllis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidCEllis/subscriptions","organizations_url":"https://api.github.com/users/DavidCEllis/orgs","repos_url":"https://api.github.com/users/DavidCEllis/repos","events_url":"https://api.github.com/users/DavidCEllis/events{/privacy}","received_events_url":"https://api.github.com/users/DavidCEllis/received_events","type":"User","site_admin":false},"created_at":"2016-11-01T19:29:42Z","updated_at":"2016-11-01T19:29:42Z","body":"@christian-storm \r\nI stumbled on the same thing when comparing a list of report titles. I'd also extracted exact matches and noticed a number of them hadn't shown up in the fuzzy search list. Ended up finding the processing issue.\r\n\r\nI've submitted some patches (PRs #140 and #142). #142 adds tests to make sure exact matches return 100 when going through process. Returning the same results for extract and ratio without specifying processor=None would require changing the default processor (replacing with a noop). I've made this easy with #142 (and doing so doesn't break any tests) but that seems a more significant behaviour change to how the process works, although I would recommend it.\r\n\r\nI think processing as functions allows for more flexibility over a preset list. It may be worth having a process_choices option that just runs on choices - although it would need to be clear if this ran before or after or instead of the main process option."}}
{"actor":{"display_login":"DavidCEllis"}}