Skip to content

Clean up scrape leftovers in the ru_RU bank list - #1068

Open
a-vasyukov wants to merge 1 commit into
FakerPHP:2.0from
a-vasyukov:fix/ru-bank-data-leftovers
Open

Clean up scrape leftovers in the ru_RU bank list#1068
a-vasyukov wants to merge 1 commit into
FakerPHP:2.0from
a-vasyukov:fix/ru-bank-data-leftovers

Conversation

@a-vasyukov

Copy link
Copy Markdown

What is the reason for this PR?

  • A new feature
  • Fixed an issue

The docblock above $banks in src/Provider/ru_RU/Payment.php records where the list came from:
788 names scraped from banki.ru on 2015-04-04 with a grep | iconv | sed pipeline. The pipeline
left three kinds of debris behind:

Problem Count Example
Raw HTML entity 1 'Дж. П. Морган Банк'
Double space where sed -r 's/—//' stripped a dash 10 'Верхневолжский Ярославский филиал'
Latin homoglyph 1 'K2 Банк' — Latin K (U+004B) instead of Cyrillic К (U+041A)

The real bank is АО «К2 Банк» (OGRN 1021500000103), spelled with a Cyrillic К, so 'K2 Банк'
never matches a search for 'К2 Банк' and sorts as a Latin word.

Double spaces are collapsed to a single space rather than restored to a dash: removing an obvious
artefact is a fix, while adding back a character that is not in the data would be a change to the
data set.

Latin letters in 'Эйч-Эс-Би-Си Банк (HSBC)' and 'Ай-Си-Ай-Си-Ай Банк (ICICI)' are left alone —
the source spells out the international brand in parentheses there, and that is intentional.

Author's checklist

Summary of changes

  • drop the   entity, collapse ten double spaces, replace the Latin K in 'K2 Банк'
  • add tests asserting that bank names carry no markup leftovers and use Latin letters only inside
    parentheses

Regarding "avoid changing existing sets of data": no entry is added, removed or reordered, so a
given seed still selects the same positions in the same order. Only characters inside 12 of the 788
values change — the characters that are the defect.

The suite stays green: 1416 tests before, 1418 with the new ones, no failures.

Review checklist

  • All checks have passed
  • Changes are added to the CHANGELOG.md
  • Changes are approved by maintainer

The bank list was scraped from banki.ru in 2015 with a grep/sed pipeline
that did not finish the job: one name still carries a raw   entity,
ten more hold a double space where sed stripped an —, and 'K2 Банк'
is spelled with a Latin K instead of the Cyrillic К of the real bank.
@a-vasyukov

Copy link
Copy Markdown
Author

Two weeks, no CI run — outside contributors need manual approval, so the added tests are verified
locally only.

One call here is yours rather than mine: the ten double spaces are collapsed to a single space, not
restored to the that sed stripped in 2015. If you read the dash as part of the original names,
I'll push that version instead.

The same defects exist in 1.24 — backport now, or after this lands?

@pwsdotru pwsdotru left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As native Russian speaker I confirm this changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants