Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLDR-17106 add more fixed candidate items #3681

Merged
merged 1 commit into from
May 11, 2024

Conversation

srl295
Copy link
Member

@srl295 srl295 commented May 2, 2024

  • restructure DataPage / DiskDataCache to hold the candidate providers
  • add a FixedCandidateProvider structure, designed to allow quick additions of future fixed candidates.

CLDR-17106

  • This PR completes the ticket.

ALLOW_MANY_COMMITS=true

- restructure DataPage / DiskDataCache to hold the candidate providers
- add a FixedCandidateProvider structure, designed to allow quick additions of future fixed candidates.
@srl295 srl295 self-assigned this May 2, 2024
@srl295
Copy link
Member Author

srl295 commented May 2, 2024

image

private final PathHeader.Factory phf;
final SupplementalDataInfo sdi;

final List<FixedCandidateProvider> personNameProviders =
Copy link
Member Author

Choose a reason for hiding this comment

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

these are not locale dependent, so kept in a separate static list.

Comment on lines +73 to +87
class GrammarCandidateProvider extends PatternCacheCandidateProvider {
final GrammarInfo grammarInfo = sdi.getGrammarInfo(locale.getBaseName());

public GrammarCandidateProvider() {
super("^//ldml/units/unitLength.*/unit.*gender");
}

@Override
protected Collection<String> getCandidates() {
return grammarInfo.get(
GrammaticalTarget.nominal,
GrammaticalFeature.grammaticalGender,
GrammaticalScope.units);
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

this one is locale dependent depends on the supplementalDataInfo in the enclosing class

@macchiati
Copy link
Member

what are "fixed candidates"?

@srl295
Copy link
Member Author

srl295 commented May 2, 2024

what are "fixed candidates"?

Candidates are options during voting… Fix candidates means that you have a fixed list instead of being able to use the plus button

@srl295
Copy link
Member Author

srl295 commented May 2, 2024

In this pull request, I tried to write it so that it was easy to add more of these later

@srl295 srl295 merged commit 10ed334 into unicode-org:main May 11, 2024
10 checks passed
@srl295 srl295 deleted the cldr-17106/more-choice-items branch May 11, 2024 23:36
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