Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into joining-type
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Feb 12, 2024
2 parents f75ad98 + 059528b commit 6a5202a
Show file tree
Hide file tree
Showing 48 changed files with 70 additions and 65 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/casemap/src/internals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ pub(crate) struct ContextIterator<'a> {
impl<'a> ContextIterator<'a> {
// Returns a context iterator with the characters before
// and after the character at a given index, given the preceding
// string and the succeding string including the character itself
// string and the succeeding string including the character itself
pub fn new(before: &'a str, char_and_after: &'a str) -> Self {
let mut char_and_after = char_and_after.chars();
char_and_after.next(); // skip the character itself
Expand Down
4 changes: 2 additions & 2 deletions components/collator/src/elements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ pub(crate) enum Tag {
/// Tag for a lead surrogate code unit.
/// Optional optimization for UTF-16 string processing.
/// Bits 31..10: Unused, 0.
/// 9.. 8: =0: All associated supplementary code points are unassigned-implict.
/// 9.. 8: =0: All associated supplementary code points are unassigned-implicit.
/// =1: All associated supplementary code points fall back to the base data.
/// else: (Normally 2) Look up the data for the supplementary code point.
/// Not used by ICU4X.
Expand Down Expand Up @@ -1980,7 +1980,7 @@ where
// `head[len - 2]` isn't a leading zero.
// * If `len == 1`: The loop condition is false, because
// `head[len - 1]` isn't a leading zero, and `&&`
// short-circuts, so the `head[len - 2]` access doesn't
// short-circuits, so the `head[len - 2]` access doesn't
// occur.
#[allow(clippy::indexing_slicing)]
while head[len - 1] == 0 && head[len - 2] == 0 {
Expand Down
2 changes: 1 addition & 1 deletion components/collator/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ pub enum BackwardSecondLevel {
/// [`core::cmp::Ordering::Less`] and [`core::cmp::Ordering::Greater`]), it is
/// possible to check if a set of human-readable strings contains a full-string
/// fuzzy match of a user-entered string, where "fuzzy" means case-insensitive and
/// accent-insentive for scripts that have such concepts and something roughly
/// accent-insensitive for scripts that have such concepts and something roughly
/// similar for other scripts.
///
/// Due to the very limited utility, ICU4X data does not include search collations
Expand Down
2 changes: 1 addition & 1 deletion components/collator/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ fn test_th_reordering() {
// supplementary composition decomps to supplementary
"\u{0E41}\u{1D15F}",
// supplementary composition decomps to BMP
"\u{0E41}\u{2F802}", /* omit bacward iteration tests
"\u{0E41}\u{2F802}", /* omit backward iteration tests
* contraction bug
* "\u{0E24}\u{0E41}",
* TODO: Support contracting starters, then add more here */
Expand Down
2 changes: 1 addition & 1 deletion components/datetime/src/fields/length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl TryFrom<u8> for FieldNumericOverrides {
}

impl FieldNumericOverrides {
/// Conver this to the corresponding string code
/// Convert this to the corresponding string code
pub fn as_str(self) -> &'static str {
match self {
Self::Hanidec => "hanidec",
Expand Down
2 changes: 1 addition & 1 deletion components/locid_transform/src/fallback/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mod algorithms;
///
/// Note that this implementation performs some additional steps compared to the *UTS #35*
/// algorithm. See *[the design doc]* for a detailed description and [#2243](
/// https://github.com/unicode-org/icu4x/issues/2243) to track aligment with *UTS #35*.
/// https://github.com/unicode-org/icu4x/issues/2243) to track alignment with *UTS #35*.
///
/// If running fallback in a loop, use [`DataLocale::is_und()`] to break from the loop.
///
Expand Down
2 changes: 1 addition & 1 deletion components/segmenter/src/complex/lstm/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl<const D: usize> MatrixOwned<D> {
}
}

/// Returns the tighly packed submatrix at _index_, or `None` if _index_ is out of range.
/// Returns the tightly packed submatrix at _index_, or `None` if _index_ is out of range.
///
/// For example, if the matrix is 5x4x3, this function returns a matrix sized 4x3. If the
/// matrix is 4x3, then this function returns a linear matrix of length 3.
Expand Down
2 changes: 1 addition & 1 deletion components/segmenter/src/complex/lstm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ mod tests {
use serde::Deserialize;

/// `TestCase` is a struct used to store a single test case.
/// Each test case has two attributs: `unseg` which denots the unsegmented line, and `true_bies` which indicates the Bies
/// Each test case has two attributes: `unseg` which denotes the unsegmented line, and `true_bies` which indicates the Bies
/// sequence representing the true segmentation.
#[derive(PartialEq, Debug, Deserialize)]
struct TestCase {
Expand Down
2 changes: 1 addition & 1 deletion components/segmenter/src/provider/lstm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl<'data> LstmDataFloat32<'data> {
}

#[cfg(any(feature = "serde", feature = "datagen"))]
/// Creates a LstmDataFloat32 with the given data. Fails if the matrix dimensions are inconsisent.
/// Creates a LstmDataFloat32 with the given data. Fails if the matrix dimensions are inconsistent.
#[allow(clippy::too_many_arguments)] // constructor
pub fn try_from_parts(
model: ModelType,
Expand Down
2 changes: 1 addition & 1 deletion docs/posts/20201015_ICU4X_Project_Announcement.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Rust provides strong bindings to [WebAssembly](https://webassembly.org/), and we
While it’s early to have exact scope settled, ICU4X aims to expose a superset of `ECMA-402` scope of APIs to a wide range of platforms such as:

* Web Platform (V8, SpiderMonkey, JSC)
* Software platforms (Fuschia, Gecko)
* Software platforms (Fuchsia, Gecko)
* Mobile OSes (iOS, Android)
* Low-power OSes with alloc (WearOS, WatchOS)
* Client-side toolkits (Flutter)
Expand Down
2 changes: 1 addition & 1 deletion docs/proposals/pr002-hunkspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ already transferred:

This proposal glosses over the gritty detail of setting up the two-way
communication over a common context, such as cache invalidation, context
cleaning and availability concerns. The designers would neeed to take them
cleaning and availability concerns. The designers would need to take them
into account when developing a production version of this proposal. The URI
encoding approach still favors statically defined messaging where such
messaging is viable.
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/c-tiny/fixeddecimal/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/tutorials/c/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/tutorials/cpp/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/tutorials/cpp/properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ int main() {
}
mask = mask_mapper.get_strict("EverythingLol");
if (mask != 0) {
std::cout << "Expected no mask for nonexistant name `EverythingLol`, found " << mask << std::endl;
std::cout << "Expected no mask for nonexistent name `EverythingLol`, found " << mask << std::endl;
result = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/data_management.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ $ cargo add litemap
$ cargo add zerovec
```

We can use the generate code with the `include!` macro. The `impl_data_provider!` macro adds the generated implemenations to any type.
We can use the generate code with the `include!` macro. The `impl_data_provider!` macro adds the generated implementations to any type.

```rust,compile_fail
extern crate alloc; // required as my-data is written for #[no_std]
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/data_management_interactive.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ We also need to enable the `serde` feature on the `icu` crate to enable deserial
cargo add icu --features serde
```

Now, update the instatiation of the datetime formatter to load data from the blob if the
Now, update the instantiation of the datetime formatter to load data from the blob if the
locale is Chakma:

```rust
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/data_provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ assert_eq!(formatter.format_to_string(&100007i64.into()), "100🐮007");

## Accessing the Resolved Locale

ICU4X objects do not store their "resolved locale" because that is not a well-defined concept. Components can load data from many sources, and fallbacks to parent locales or root does not necesarily mean that a locale is not supported.
ICU4X objects do not store their "resolved locale" because that is not a well-defined concept. Components can load data from many sources, and fallbacks to parent locales or root does not necessarily mean that a locale is not supported.

However, for environments that require this behavior, such as ECMA-402, the data provider can be instrumented to access the resolved locale from `DataResponseMetadata`, as shown in the following example.

Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/js-tiny/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/tutorials/rust/baked/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/tutorials/rust/experimental/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion experimental/components/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ path = "tests/transliterate/cldr.rs"

[[test]]
name = "units_test"
path = "tests/unitsconversion/units_test.rs"
path = "tests/units/units_test.rs"
4 changes: 2 additions & 2 deletions experimental/components/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub mod personnames;
pub mod relativetime;
pub mod transliterate;
pub mod unicodeset_parse;
pub mod unitsconversion;
pub mod units;

#[doc(hidden)]
// Compiled constructors look for the baked provider at crate::provider::Baked,
Expand Down Expand Up @@ -114,6 +114,6 @@ pub mod provider {
super::relativetime::provider::ShortSecondRelativeTimeFormatDataV1Marker::KEY,
super::relativetime::provider::ShortWeekRelativeTimeFormatDataV1Marker::KEY,
super::relativetime::provider::ShortYearRelativeTimeFormatDataV1Marker::KEY,
super::unitsconversion::provider::UnitsInfoV1Marker::KEY,
super::units::provider::UnitsInfoV1Marker::KEY,
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use crate::unitsconversion::{
use crate::units::{
measureunit::{MeasureUnit, MeasureUnitParser},
provider::{Base, MeasureUnitItem, SiPrefix, Sign, SignULE, UnitsInfoV1},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use smallvec::SmallVec;
use zerotrie::ZeroTrieSimpleAscii;
use zerovec::ZeroVec;

use crate::unitsconversion::{
use crate::units::{
power::get_power,
provider::{Base, MeasureUnitItem, SiPrefix},
si_prefix::get_si_prefix,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub use crate::provider::Baked;
#[cfg_attr(
feature = "datagen",
derive(serde::Serialize, databake::Bake),
databake(path = icu_experimental::unitsconversion::provider),
databake(path = icu_experimental::units::provider),
)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
#[yoke(prove_covariance_manually)]
Expand All @@ -57,7 +57,7 @@ pub struct UnitsInfoV1<'data> {
#[cfg_attr(
feature = "datagen",
derive(databake::Bake),
databake(path = icu_experimental::unitsconversion::provider),
databake(path = icu_experimental::units::provider),
)]
#[cfg_attr(
feature = "datagen",
Expand Down Expand Up @@ -108,7 +108,7 @@ pub struct ConversionInfo<'data> {
#[cfg_attr(
feature = "datagen",
derive(serde::Serialize, databake::Bake),
databake(path = icu_experimental::unitsconversion::provider),
databake(path = icu_experimental::units::provider),
)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
#[derive(Copy, Clone, Debug, PartialOrd, Ord, PartialEq, Eq, Default)]
Expand All @@ -124,7 +124,7 @@ pub enum Sign {
#[cfg_attr(
feature = "datagen",
derive(serde::Serialize, databake::Bake),
databake(path = icu_experimental::unitsconversion::provider),
databake(path = icu_experimental::units::provider),
)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
#[derive(Copy, Clone, Debug, PartialOrd, Ord, PartialEq, Eq, Default)]
Expand All @@ -139,7 +139,7 @@ pub enum Exactness {
#[cfg_attr(
feature = "datagen",
derive(serde::Serialize, databake::Bake),
databake(path = icu_experimental::unitsconversion::provider),
databake(path = icu_experimental::units::provider),
)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
#[derive(Copy, Clone, Debug, PartialOrd, Ord, PartialEq, Eq, Default)]
Expand All @@ -162,7 +162,7 @@ pub enum Base {
#[cfg_attr(
feature = "datagen",
derive(serde::Serialize, databake::Bake),
databake(path = icu_experimental::unitsconversion::provider),
databake(path = icu_experimental::units::provider),
)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct MeasureUnitItem {
Expand All @@ -183,7 +183,7 @@ pub struct MeasureUnitItem {
#[cfg_attr(
feature = "datagen",
derive(serde::Serialize, databake::Bake),
databake(path = icu_experimental::unitsconversion::provider),
databake(path = icu_experimental::units::provider),
)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct SiPrefix {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use zerotrie::ZeroTrieSimpleAscii;

use crate::unitsconversion::provider::{Base, SiPrefix};
use crate::units::provider::{Base, SiPrefix};

/// The offset of the SI prefixes.
/// NOTE:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use core::str::FromStr;
use icu_experimental::unitsconversion::converter::ConverterFactory;
use icu_experimental::units::converter::ConverterFactory;
use num_bigint::BigInt;
use num_rational::BigRational;
use num_rational::Ratio;
Expand Down Expand Up @@ -64,7 +64,7 @@ fn test_cldr_unit_tests() {
result: BigRational,
}

let data = std::fs::read_to_string("tests/unitsconversion/data/unitsTest.txt").unwrap();
let data = std::fs::read_to_string("tests/units/data/unitsTest.txt").unwrap();
let tests: Vec<UnitsTest> = data
.lines()
.filter(|line| !line.starts_with('#') && !line.is_empty())
Expand All @@ -79,14 +79,14 @@ fn test_cldr_unit_tests() {
})
.collect();

let store = icu_experimental::unitsconversion::provider::Baked::SINGLETON_UNITS_INFO_V1
let store = icu_experimental::units::provider::Baked::SINGLETON_UNITS_INFO_V1
.units_conversion_trie
.clone() // cheap since store is a borrowed ZeroVec
.take_store();

let payload_store = &ZeroTrieSimpleAscii::from_store(store);
let converter_factory = ConverterFactory::from_payload(
icu_experimental::unitsconversion::provider::Baked::SINGLETON_UNITS_INFO_V1,
icu_experimental::units::provider::Baked::SINGLETON_UNITS_INFO_V1,
payload_store,
);
let parser = converter_factory.parser();
Expand Down Expand Up @@ -131,14 +131,14 @@ fn test_units_not_parsable() {
"kilo-squared-meter",
];

let store = icu_experimental::unitsconversion::provider::Baked::SINGLETON_UNITS_INFO_V1
let store = icu_experimental::units::provider::Baked::SINGLETON_UNITS_INFO_V1
.units_conversion_trie
.clone() // cheap since store is a borrowed ZeroVec
.take_store();

let payload_store = &ZeroTrieSimpleAscii::from_store(store);
let converter_factory = ConverterFactory::from_payload(
icu_experimental::unitsconversion::provider::Baked::SINGLETON_UNITS_INFO_V1,
icu_experimental::units::provider::Baked::SINGLETON_UNITS_INFO_V1,
payload_store,
);
let parser = converter_factory.parser();
Expand Down
2 changes: 1 addition & 1 deletion ffi/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ffi/capi/bindings/cpp/ICU4XCodePointMapData8.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6a5202a

Please sign in to comment.