Skip to content

feat: Split affinity value between SAME and MUTUALLY_INTELLIGIBLE#22

Merged
ericfjosne merged 2 commits intomainfrom
feat-Split-affinity-between-SAME-and-MUTUALLY_INTELLIGIBLE
Jun 17, 2025
Merged

feat: Split affinity value between SAME and MUTUALLY_INTELLIGIBLE#22
ericfjosne merged 2 commits intomainfrom
feat-Split-affinity-between-SAME-and-MUTUALLY_INTELLIGIBLE

Conversation

@ericfjosne
Copy link
Copy Markdown
Collaborator

@ericfjosne ericfjosne commented Jun 17, 2025

The current SAME_OR_MUTUALLY_INTELLIGIBLE locale affinity value was the only option originally, as we relied on the distance between locales to derive an affinity. But this is not ideal, as having SAME and MUTUALLY_INTELLIGIBLE bundled together makes it impossible to differentiate between what is actually the same language and what is something the user would still understand, but from a different language.

Thanks to the addition of the new spoken language matcher, in LanguageUtils, we are now be able to split the locale affinity value SAME_OR_MUTUALLY_INTELLIGIBLE into:

  • MUTUALLY_INTELLIGIBLE: Locales identify languages that are similar to a point where a person should understand both if they understand one of them.
  • SAME: Locales identify the same language.

Examples:

  • for SAME: fr, fr-BE, fr-LU, fr-CH, fr-SE, fr-JP all identify French.
  • for MUTUALLY_INTELLIGIBLE: bs (Bosnian) and Croatian (hr).

We suggest implementing this split, as part of this pull request.

Incidentally, we discovered what might actually be a bug in icu4j: hr-BA (Croatian, Bosnia) is best matched with bs Bosnian instead of hr Croatian. We will need to validate this behavior with Unicode, but implemented a work around in the LanguageUtils class for now.

@ericfjosne ericfjosne force-pushed the feat-Split-affinity-between-SAME-and-MUTUALLY_INTELLIGIBLE branch from acc1872 to 0efa4ab Compare June 17, 2025 09:34
Comment thread README.md Outdated
@ericfjosne ericfjosne merged commit 448005f into main Jun 17, 2025
1 check passed
@ericfjosne ericfjosne deleted the feat-Split-affinity-between-SAME-and-MUTUALLY_INTELLIGIBLE branch June 23, 2025 09:24
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