Skip to content

Refactor MeasureUnitParser and update related components #6328

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

Merged
merged 18 commits into from
Mar 25, 2025

Conversation

younies
Copy link
Member

@younies younies commented Mar 20, 2025

Description:

  • Removed the dependency on ZeroTrieSimpleAscii in MeasureUnitParser, replacing it with DataPayload for better data handling.
  • Updating the constructors for MeasureUnitParser, including a stable constructor and an unstable one that accepts a data provider.
  • Updated tests to directly instantiate MeasureUnitParser instead of using ConverterFactory.
  • Refactored UnitsInfo to replace units_conversion_trie with conversion_info, aligning with the new data structure.
  • Adjusted related components and tests to reflect these changes, ensuring consistency across the measurement unit parsing functionality.
  • Create measure_unit_parser.rs in FFI

- Removed the dependency on `ZeroTrieSimpleAscii` in `MeasureUnitParser`, replacing it with `DataPayload` for better data handling.
- Introduced new constructors for `MeasureUnitParser`, including a stable constructor and an unstable one that accepts a data provider.
- Updated tests to directly instantiate `MeasureUnitParser` instead of using `ConverterFactory`.
- Refactored `UnitsInfo` to replace `units_conversion_trie` with `conversion_info`, aligning with the new data structure.
- Adjusted related components and tests to reflect these changes, ensuring consistency across the measurement unit parsing functionality.
@younies younies requested review from sffc, robertbastian, Manishearth and a team as code owners March 20, 2025 06:40
DataError::custom("Could not create ZeroTrie from units.json data")
.with_display_context(&e)
})?;
// TODO: now we need to create `MeasureUnitParser` in order to create the conversion info. how to do that ?
Copy link
Member Author

Choose a reason for hiding this comment

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

@robertbastian , @Manishearth
Now, in order to create the ConversionInfoV1, we need to have a measure unit parser, and measure unit parser is depending on UnitsInfoV1, how can I do that ?

Copy link
Member

Choose a reason for hiding this comment

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

I don't understand the question: things can depend on each other just fine

@younies younies marked this pull request as draft March 20, 2025 06:44
@younies younies marked this pull request as ready for review March 24, 2025 09:06
@sffc sffc removed their request for review March 25, 2025 03:32
@younies younies requested a review from robertbastian March 25, 2025 04:56
@younies younies merged commit 5f41720 into unicode-org:main Mar 25, 2025
28 checks passed
@younies younies deleted the remove-redundants-2 branch March 25, 2025 11:10
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.

3 participants