pub fn create_best_pattern_for_fields<'data>(
skeletons: &DateSkeletonPatternsV1<'data>,
length_patterns: &GenericLengthPatternsV1<'data>,
fields: &[Field],
components: &Bag,
prefer_matched_pattern: bool,
) -> BestSkeleton<PatternPlurals<'data>>
Expand description
Given a set of fields (which represents a skeleton), try to create a best localized pattern
skeletons
- The skeletons that will be matched againstlength_patterns
- Contains information on how to combine date and time patterns.fields
- The desired fields to match against.prefer_matched_pattern
- This algorithm does some extra steps of trying to respect the desired fields, even if the provider data doesn’t completely match. This configuration option makes it so that the final pattern won’t have additional work done to mutate it to match the fields. It will prefer the actual matched pattern.