diff --git a/CODEOWNERS b/CODEOWNERS index fa307a675ba..12b3b0e3b14 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -8,6 +8,6 @@ # List of components with at least two owners as specified in docs/crate-ownership. components/locale/ @zbraniecki @nciric -components/pluralrules @zbraniecki @sffc +components/plurals/ @zbraniecki @sffc components/data-provider/ @sffc components/data-provider-json/ @sffc diff --git a/Cargo.toml b/Cargo.toml index a1f7111aaf7..25bc5cad3d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ members = [ "components/uniset", "components/locale", "components/locale/macros", - "components/pluralrules", + "components/plurals", "components/datetime", "resources/testdata", "utils/fixed-decimal", diff --git a/components/cldr-json-data-provider/Cargo.toml b/components/cldr-json-data-provider/Cargo.toml index 8d2a8de176f..c23e3fd9ed2 100644 --- a/components/cldr-json-data-provider/Cargo.toml +++ b/components/cldr-json-data-provider/Cargo.toml @@ -17,7 +17,7 @@ include = [ [dependencies] icu-data-provider = { path = "../data-provider" } icu-locale = { path = "../locale" } -icu-pluralrules = { path = "../pluralrules" } +icu-plurals = { path = "../plurals" } json = "0.12" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/components/cldr-json-data-provider/src/transform/plurals.rs b/components/cldr-json-data-provider/src/transform/plurals.rs index 73e39510d1a..47b60248bce 100644 --- a/components/cldr-json-data-provider/src/transform/plurals.rs +++ b/components/cldr-json-data-provider/src/transform/plurals.rs @@ -5,7 +5,7 @@ use crate::CldrPaths; use icu_data_provider::iter::DataEntryCollection; use icu_data_provider::prelude::*; use icu_data_provider::structs::plurals::*; -use icu_pluralrules::rules::{parse, serialize}; +use icu_plurals::rules::{parse, serialize}; use std::borrow::Cow; use std::convert::TryFrom; use std::marker::PhantomData; diff --git a/components/icu/Cargo.toml b/components/icu/Cargo.toml index e258e9f55d9..ccc8f19b8bf 100644 --- a/components/icu/Cargo.toml +++ b/components/icu/Cargo.toml @@ -17,8 +17,8 @@ include = [ [dependencies] icu-datetime = { path = "../datetime" } icu-locale = { path = "../locale" } -icu-pluralrules = { path = "../pluralrules" } -icu-unicodeset = { path = "../uniset" } +icu-plurals = { path = "../plurals" } +icu-uniset = { path = "../uniset" } [dev-dependencies] icu-testdata = { path = "../../resources/testdata" } diff --git a/components/icu/src/lib.rs b/components/icu/src/lib.rs index 248d0f78cee..43c39c494a6 100644 --- a/components/icu/src/lib.rs +++ b/components/icu/src/lib.rs @@ -62,6 +62,6 @@ pub use icu_datetime as datetime; #[doc(inline)] pub use icu_locale as locale; #[doc(inline)] -pub use icu_pluralrules as plurals; +pub use icu_plurals as plurals; #[doc(inline)] -pub use icu_unicodeset as uniset; +pub use icu_uniset as uniset; diff --git a/components/pluralrules/Cargo.toml b/components/plurals/Cargo.toml similarity index 97% rename from components/pluralrules/Cargo.toml rename to components/plurals/Cargo.toml index 93e22ae8501..af6c7778253 100644 --- a/components/pluralrules/Cargo.toml +++ b/components/plurals/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "icu-pluralrules" +name = "icu-plurals" description = "Unicode Plural Rules categorizer for numeric input." version = "0.0.1" authors = ["The ICU4X Project Developers"] diff --git a/components/pluralrules/benches/fixtures/mod.rs b/components/plurals/benches/fixtures/mod.rs similarity index 97% rename from components/pluralrules/benches/fixtures/mod.rs rename to components/plurals/benches/fixtures/mod.rs index 52e7a78cd6f..f6008c774e9 100644 --- a/components/pluralrules/benches/fixtures/mod.rs +++ b/components/plurals/benches/fixtures/mod.rs @@ -1,5 +1,5 @@ use icu_locale::LanguageIdentifier; -use icu_pluralrules::PluralCategory; +use icu_plurals::PluralCategory; use serde::Deserialize; diff --git a/components/pluralrules/benches/fixtures/numbers.json b/components/plurals/benches/fixtures/numbers.json similarity index 100% rename from components/pluralrules/benches/fixtures/numbers.json rename to components/plurals/benches/fixtures/numbers.json diff --git a/components/pluralrules/benches/fixtures/plurals.json b/components/plurals/benches/fixtures/plurals.json similarity index 100% rename from components/pluralrules/benches/fixtures/plurals.json rename to components/plurals/benches/fixtures/plurals.json diff --git a/components/pluralrules/benches/helpers/mod.rs b/components/plurals/benches/helpers/mod.rs similarity index 100% rename from components/pluralrules/benches/helpers/mod.rs rename to components/plurals/benches/helpers/mod.rs diff --git a/components/pluralrules/benches/operands.rs b/components/plurals/benches/operands.rs similarity index 99% rename from components/pluralrules/benches/operands.rs rename to components/plurals/benches/operands.rs index 3d603db4580..83f514464d3 100644 --- a/components/pluralrules/benches/operands.rs +++ b/components/plurals/benches/operands.rs @@ -3,7 +3,7 @@ mod helpers; use criterion::{black_box, criterion_group, criterion_main, Criterion}; use fixed_decimal::FixedDecimal; -use icu_pluralrules::PluralOperands; +use icu_plurals::PluralOperands; use std::convert::TryInto; fn operands(c: &mut Criterion) { diff --git a/components/pluralrules/benches/parser.rs b/components/plurals/benches/parser.rs similarity index 94% rename from components/pluralrules/benches/parser.rs rename to components/plurals/benches/parser.rs index 0ed9a02e949..14a1c14e67f 100644 --- a/components/pluralrules/benches/parser.rs +++ b/components/plurals/benches/parser.rs @@ -7,7 +7,7 @@ use icu_data_provider::{icu_data_key, structs, DataEntry, DataProvider, DataRequ use std::borrow::Cow; fn parser(c: &mut Criterion) { - use icu_pluralrules::rules::parse_condition; + use icu_plurals::rules::parse_condition; let plurals_data = helpers::get_plurals_data(); @@ -53,7 +53,7 @@ fn parser(c: &mut Criterion) { #[cfg(feature = "bench")] c.bench_function("parser/lex", |b| { - use icu_pluralrules::rules::Lexer; + use icu_plurals::rules::Lexer; b.iter(|| { for rule in &rules { let _ = Lexer::new(black_box(rule.as_bytes())).count(); diff --git a/components/pluralrules/benches/pluralrules.rs b/components/plurals/benches/pluralrules.rs similarity index 96% rename from components/pluralrules/benches/pluralrules.rs rename to components/plurals/benches/pluralrules.rs index e85ed2b790f..8c2ff855b45 100644 --- a/components/pluralrules/benches/pluralrules.rs +++ b/components/plurals/benches/pluralrules.rs @@ -3,7 +3,7 @@ mod helpers; use criterion::{criterion_group, criterion_main, Criterion}; -use icu_pluralrules::{PluralRuleType, PluralRules}; +use icu_plurals::{PluralRuleType, PluralRules}; fn pluralrules(c: &mut Criterion) { let plurals_data = helpers::get_plurals_data(); diff --git a/components/pluralrules/examples/elevator_floors.rs b/components/plurals/examples/elevator_floors.rs similarity index 89% rename from components/pluralrules/examples/elevator_floors.rs rename to components/plurals/examples/elevator_floors.rs index a9cf340a4ca..3ddda98961d 100644 --- a/components/pluralrules/examples/elevator_floors.rs +++ b/components/plurals/examples/elevator_floors.rs @@ -1,7 +1,7 @@ -// An example application which uses icu_pluralrules to construct a correct +// An example application which uses icu_plurals to construct a correct // sentence for English based on the numerical value in Ordinal category. use icu_locale::LanguageIdentifier; -use icu_pluralrules::{PluralCategory, PluralRuleType, PluralRules}; +use icu_plurals::{PluralCategory, PluralRuleType, PluralRules}; const VALUES: &[usize] = &[0, 2, 25, 1, 3, 2, 4, 10, 7, 0]; diff --git a/components/pluralrules/examples/unread_emails.rs b/components/plurals/examples/unread_emails.rs similarity index 87% rename from components/pluralrules/examples/unread_emails.rs rename to components/plurals/examples/unread_emails.rs index e048aab4a27..387fd05c266 100644 --- a/components/pluralrules/examples/unread_emails.rs +++ b/components/plurals/examples/unread_emails.rs @@ -1,7 +1,7 @@ -// An example application which uses icu_pluralrules to construct a correct +// An example application which uses icu_plurals to construct a correct // sentence for English based on the numerical value in Cardinal category. use icu_locale::LanguageIdentifier; -use icu_pluralrules::{PluralCategory, PluralRuleType, PluralRules}; +use icu_plurals::{PluralCategory, PluralRuleType, PluralRules}; const VALUES: &[usize] = &[0, 2, 25, 1, 3, 2, 4, 10, 7, 0]; diff --git a/components/pluralrules/src/data.rs b/components/plurals/src/data.rs similarity index 97% rename from components/pluralrules/src/data.rs rename to components/plurals/src/data.rs index ac7edbef5f2..5fab888d59c 100644 --- a/components/pluralrules/src/data.rs +++ b/components/plurals/src/data.rs @@ -4,8 +4,8 @@ //! //! ``` //! use icu_locale::LanguageIdentifier; -//! use icu_pluralrules::{PluralCategory, PluralRuleType, PluralOperands}; -//! use icu_pluralrules::data::{PluralRuleList, RulesSelector}; +//! use icu_plurals::{PluralCategory, PluralRuleType, PluralOperands}; +//! use icu_plurals::data::{PluralRuleList, RulesSelector}; //! use icu_data_provider::prelude::*; //! use icu_data_provider::{InvariantDataProvider, structs}; //! use std::borrow::Cow; diff --git a/components/pluralrules/src/error.rs b/components/plurals/src/error.rs similarity index 100% rename from components/pluralrules/src/error.rs rename to components/plurals/src/error.rs diff --git a/components/pluralrules/src/lib.rs b/components/plurals/src/lib.rs similarity index 95% rename from components/pluralrules/src/lib.rs rename to components/plurals/src/lib.rs index e90218f0ce1..e13752ee4e9 100644 --- a/components/pluralrules/src/lib.rs +++ b/components/plurals/src/lib.rs @@ -1,4 +1,4 @@ -//! `icu-pluralrules` is one of the [`ICU4X`] components. +//! `icu-plurals` is one of the [`ICU4X`] components. //! //! This API provides functionality to determine the plural category //! appropriate for a given number in a given language. @@ -21,7 +21,7 @@ //! //! ``` //! use icu_locale::LanguageIdentifier; -//! use icu_pluralrules::{PluralRules, PluralRuleType, PluralCategory}; +//! use icu_plurals::{PluralRules, PluralRuleType, PluralCategory}; //! use icu_data_provider::InvariantDataProvider; //! //! let lang: LanguageIdentifier = "en".parse() @@ -131,7 +131,7 @@ pub enum PluralRuleType { /// /// ``` /// use icu_locale::LanguageIdentifier; -/// use icu_pluralrules::{PluralRules, PluralRuleType, PluralCategory}; +/// use icu_plurals::{PluralRules, PluralRuleType, PluralCategory}; /// use icu_data_provider::InvariantDataProvider; /// /// let lang: LanguageIdentifier = "en".parse() @@ -207,7 +207,7 @@ impl PluralCategory { /// # Examples /// /// ``` - /// use icu_pluralrules::PluralCategory; + /// use icu_plurals::PluralCategory; /// /// let mut categories = PluralCategory::all(); /// @@ -239,7 +239,7 @@ impl PluralCategory { /// /// ``` /// use icu_locale::LanguageIdentifier; -/// use icu_pluralrules::{PluralRules, PluralRuleType, PluralCategory}; +/// use icu_plurals::{PluralRules, PluralRuleType, PluralCategory}; /// use icu_data_provider::InvariantDataProvider; /// /// let lang: LanguageIdentifier = "en".parse() @@ -271,7 +271,7 @@ impl PluralRules { /// /// ``` /// use icu_locale::LanguageIdentifier; - /// use icu_pluralrules::{PluralRules, PluralRuleType}; + /// use icu_plurals::{PluralRules, PluralRuleType}; /// use icu_data_provider::InvariantDataProvider; /// /// let lang: LanguageIdentifier = "en".parse() @@ -316,7 +316,7 @@ impl PluralRules { /// /// ``` /// use icu_locale::LanguageIdentifier; - /// use icu_pluralrules::{PluralRules, PluralRuleType, PluralCategory}; + /// use icu_plurals::{PluralRules, PluralRuleType, PluralCategory}; /// use icu_data_provider::InvariantDataProvider; /// /// let lang: LanguageIdentifier = "en".parse() @@ -346,8 +346,8 @@ impl PluralRules { /// ``` /// # use std::convert::TryFrom; /// # use icu_locale::LanguageIdentifier; - /// # use icu_pluralrules::{PluralRules, PluralRuleType}; - /// use icu_pluralrules::{PluralCategory, PluralOperands}; + /// # use icu_plurals::{PluralRules, PluralRuleType}; + /// use icu_plurals::{PluralCategory, PluralOperands}; /// # use icu_data_provider::InvariantDataProvider; /// # /// # let lang: LanguageIdentifier = "en".parse() diff --git a/components/pluralrules/src/operands.rs b/components/plurals/src/operands.rs similarity index 98% rename from components/pluralrules/src/operands.rs rename to components/plurals/src/operands.rs index 00dbfee8ca7..06fd4e2dd53 100644 --- a/components/pluralrules/src/operands.rs +++ b/components/plurals/src/operands.rs @@ -15,7 +15,7 @@ use std::str::FromStr; /// From int /// /// ``` -/// use icu_pluralrules::PluralOperands; +/// use icu_plurals::PluralOperands; /// assert_eq!(PluralOperands { /// i: 2, /// v: 0, @@ -29,7 +29,7 @@ use std::str::FromStr; /// /// ``` /// use std::str::FromStr; -/// use icu_pluralrules::PluralOperands; +/// use icu_plurals::PluralOperands; /// assert_eq!(Ok(PluralOperands { /// i: 1234, /// v: 3, @@ -43,7 +43,7 @@ use std::str::FromStr; /// /// ``` /// use std::convert::TryFrom; -/// use icu_pluralrules::PluralOperands; +/// use icu_plurals::PluralOperands; /// assert_eq!(Ok(PluralOperands { /// i: 123, /// v: 2, diff --git a/components/pluralrules/src/rules/ast.rs b/components/plurals/src/rules/ast.rs similarity index 93% rename from components/pluralrules/src/rules/ast.rs rename to components/plurals/src/rules/ast.rs index 62279dcac13..018129ffaa3 100644 --- a/components/pluralrules/src/rules/ast.rs +++ b/components/plurals/src/rules/ast.rs @@ -5,8 +5,8 @@ //! # Examples //! //! ``` -//! use icu_pluralrules::rules::parse_condition; -//! use icu_pluralrules::rules::ast::*; +//! use icu_plurals::rules::parse_condition; +//! use icu_plurals::rules::ast::*; //! //! let input = "i = 1"; //! @@ -42,8 +42,8 @@ use std::ops::RangeInclusive; /// # Examples /// /// ``` -/// use icu_pluralrules::rules::ast::*; -/// use icu_pluralrules::rules::{parse, parse_condition}; +/// use icu_plurals::rules::ast::*; +/// use icu_plurals::rules::{parse, parse_condition}; /// /// let condition = parse_condition(b"i = 5 or v = 2") /// .expect("Parsing failed."); @@ -87,8 +87,8 @@ pub struct Rule { /// # Examples /// /// ``` -/// use icu_pluralrules::rules::ast::*; -/// use icu_pluralrules::rules::parse_condition; +/// use icu_plurals::rules::ast::*; +/// use icu_plurals::rules::parse_condition; /// /// let condition = Condition(Box::new([ /// AndCondition(Box::new([Relation { @@ -131,7 +131,7 @@ pub struct Condition(pub Box<[AndCondition]>); /// Can be represented by the AST: /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// /// AndCondition(Box::new([ /// Relation { @@ -169,7 +169,7 @@ pub struct AndCondition(pub Box<[Relation]>); /// Can be represented by the AST: /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// /// Relation { /// expression: Expression { @@ -216,7 +216,7 @@ pub enum Operator { /// Can be represented by the AST: /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// /// Expression { /// operand: Operand::I, @@ -243,7 +243,7 @@ pub struct Expression { /// Can be represented by the AST: /// /// ``` -/// use icu_pluralrules::rules::ast::Operand; +/// use icu_plurals::rules::ast::Operand; /// /// Operand::I; /// ``` @@ -276,7 +276,7 @@ pub enum Operand { /// Can be represented by the AST: /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// /// RangeList(Box::new([ /// RangeListItem::Value(Value(5)), @@ -302,7 +302,7 @@ pub struct RangeList(pub Box<[RangeListItem]>); /// Can be represented by the AST: /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// /// let _ = RangeListItem::Value(Value(5)); /// let _ = RangeListItem::Range(Value(11)..=Value(15)); @@ -326,7 +326,7 @@ pub enum RangeListItem { /// Can be represented by the AST: /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// /// RangeListItem::Value(Value(99)); /// ``` @@ -342,7 +342,7 @@ pub struct Value(pub u64); /// ``` /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// Samples { /// integer: Some(SampleList { /// sample_ranges: Box::new([SampleRange { @@ -375,7 +375,7 @@ pub struct Samples { /// ``` /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// SampleList { /// sample_ranges: Box::new([ /// SampleRange { @@ -401,7 +401,7 @@ pub struct SampleList { /// ``` /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// SampleRange { /// lower_val: DecimalValue("0.0".to_string()), /// upper_val: Some(DecimalValue("1.5".to_string())), @@ -422,7 +422,7 @@ pub struct SampleRange { /// ``` /// /// ``` -/// use icu_pluralrules::rules::ast::*; +/// use icu_plurals::rules::ast::*; /// DecimalValue("1.00".to_string()); /// ``` #[derive(Debug, Clone, PartialEq)] diff --git a/components/pluralrules/src/rules/lexer.rs b/components/plurals/src/rules/lexer.rs similarity index 98% rename from components/pluralrules/src/rules/lexer.rs rename to components/plurals/src/rules/lexer.rs index f032d7576dd..11406b45c7e 100644 --- a/components/pluralrules/src/rules/lexer.rs +++ b/components/plurals/src/rules/lexer.rs @@ -32,7 +32,7 @@ pub enum LexerError { /// # Examples /// /// ``` -/// use icu_pluralrules::rules::Lexer; +/// use icu_plurals::rules::Lexer; /// /// let input = b"i = 5"; /// let lexer = Lexer::new(input); @@ -49,7 +49,7 @@ impl<'l> Lexer<'l> { /// # Examples /// /// ``` - /// use icu_pluralrules::rules::Lexer; + /// use icu_plurals::rules::Lexer; /// /// Lexer::new(b"n = 1"); /// ``` diff --git a/components/pluralrules/src/rules/mod.rs b/components/plurals/src/rules/mod.rs similarity index 95% rename from components/pluralrules/src/rules/mod.rs rename to components/plurals/src/rules/mod.rs index 327a065c20f..3e02bcfbdc4 100644 --- a/components/pluralrules/src/rules/mod.rs +++ b/components/plurals/src/rules/mod.rs @@ -24,7 +24,7 @@ //! That value expanded into [`PluralOperands`] looks like this: //! //! ``` -//! use icu_pluralrules::PluralOperands; +//! use icu_plurals::PluralOperands; //! PluralOperands { //! i: 1, //! v: 0, @@ -48,8 +48,8 @@ //! When parsed, the resulting [`AST`] will look like this: //! //! ``` -//! use icu_pluralrules::rules::parse_condition; -//! use icu_pluralrules::rules::ast::*; +//! use icu_plurals::rules::parse_condition; +//! use icu_plurals::rules::ast::*; //! //! let input = "i = 1 and v = 0 @integer 1"; //! @@ -90,8 +90,8 @@ //! matches: //! //! ``` -//! use icu_pluralrules::rules::{test_condition, parse_condition}; -//! use icu_pluralrules::PluralOperands; +//! use icu_plurals::rules::{test_condition, parse_condition}; +//! use icu_plurals::PluralOperands; //! //! let input = "i = 1 and v = 0 @integer 1"; //! diff --git a/components/pluralrules/src/rules/parser.rs b/components/plurals/src/rules/parser.rs similarity index 99% rename from components/pluralrules/src/rules/parser.rs rename to components/plurals/src/rules/parser.rs index ad32a4e8d45..716c7c5aea7 100644 --- a/components/pluralrules/src/rules/parser.rs +++ b/components/plurals/src/rules/parser.rs @@ -29,7 +29,7 @@ pub enum ParserError { /// # Examples /// /// ``` -/// use icu_pluralrules::rules::parse; +/// use icu_plurals::rules::parse; /// /// let input = b"i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04"; /// assert_eq!(parse(input).is_ok(), true); @@ -57,7 +57,7 @@ pub fn parse(input: &[u8]) -> Result { /// # Examples /// /// ``` -/// use icu_pluralrules::rules::parse_condition; +/// use icu_plurals::rules::parse_condition; /// /// let input = b"i = 0 or n = 1"; /// assert_eq!(parse_condition(input).is_ok(), true); diff --git a/components/pluralrules/src/rules/resolver.rs b/components/plurals/src/rules/resolver.rs similarity index 96% rename from components/pluralrules/src/rules/resolver.rs rename to components/plurals/src/rules/resolver.rs index 1bbff54d0d5..a26f95f75a9 100644 --- a/components/pluralrules/src/rules/resolver.rs +++ b/components/plurals/src/rules/resolver.rs @@ -7,8 +7,8 @@ use crate::operands::PluralOperands; /// # Examples /// /// ``` -/// use icu_pluralrules::PluralOperands; -/// use icu_pluralrules::rules::{parse_condition, test_condition}; +/// use icu_plurals::PluralOperands; +/// use icu_plurals::rules::{parse_condition, test_condition}; /// /// let operands = PluralOperands::from(5_usize); /// let condition = parse_condition(b"i = 4..6") diff --git a/components/pluralrules/src/rules/serializer.rs b/components/plurals/src/rules/serializer.rs similarity index 97% rename from components/pluralrules/src/rules/serializer.rs rename to components/plurals/src/rules/serializer.rs index 5b7b4eba98d..f44554ab74d 100644 --- a/components/pluralrules/src/rules/serializer.rs +++ b/components/plurals/src/rules/serializer.rs @@ -7,9 +7,9 @@ use std::ops::RangeInclusive; /// # Examples /// /// ``` -/// use icu_pluralrules::rules::parse; -/// use icu_pluralrules::rules::ast; -/// use icu_pluralrules::rules::serialize; +/// use icu_plurals::rules::parse; +/// use icu_plurals::rules::ast; +/// use icu_plurals::rules::serialize; /// /// let input = "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04"; /// diff --git a/components/pluralrules/tests/fixtures/mod.rs b/components/plurals/tests/fixtures/mod.rs similarity index 98% rename from components/pluralrules/tests/fixtures/mod.rs rename to components/plurals/tests/fixtures/mod.rs index d419f94a70a..c2095c43610 100644 --- a/components/pluralrules/tests/fixtures/mod.rs +++ b/components/plurals/tests/fixtures/mod.rs @@ -1,5 +1,5 @@ use fixed_decimal::FixedDecimal; -use icu_pluralrules::PluralOperands; +use icu_plurals::PluralOperands; use serde::Deserialize; use std::convert::TryInto; diff --git a/components/pluralrules/tests/fixtures/operands.json b/components/plurals/tests/fixtures/operands.json similarity index 100% rename from components/pluralrules/tests/fixtures/operands.json rename to components/plurals/tests/fixtures/operands.json diff --git a/components/pluralrules/tests/fixtures/rules.json b/components/plurals/tests/fixtures/rules.json similarity index 100% rename from components/pluralrules/tests/fixtures/rules.json rename to components/plurals/tests/fixtures/rules.json diff --git a/components/pluralrules/tests/helpers.rs b/components/plurals/tests/helpers.rs similarity index 100% rename from components/pluralrules/tests/helpers.rs rename to components/plurals/tests/helpers.rs diff --git a/components/pluralrules/tests/operands.rs b/components/plurals/tests/operands.rs similarity index 98% rename from components/pluralrules/tests/operands.rs rename to components/plurals/tests/operands.rs index 850ce91f2b3..5ed4f6092bf 100644 --- a/components/pluralrules/tests/operands.rs +++ b/components/plurals/tests/operands.rs @@ -4,7 +4,7 @@ mod helpers; use std::convert::TryInto; use fixed_decimal::FixedDecimal; -use icu_pluralrules::PluralOperands; +use icu_plurals::PluralOperands; #[test] fn test_parsing_operands() { diff --git a/components/pluralrules/tests/plurals.rs b/components/plurals/tests/plurals.rs similarity index 91% rename from components/pluralrules/tests/plurals.rs rename to components/plurals/tests/plurals.rs index 4be5ad0f424..b3069acb396 100644 --- a/components/pluralrules/tests/plurals.rs +++ b/components/plurals/tests/plurals.rs @@ -1,5 +1,5 @@ use icu_locale::LanguageIdentifier; -use icu_pluralrules::{PluralCategory, PluralRuleType, PluralRules}; +use icu_plurals::{PluralCategory, PluralRuleType, PluralRules}; #[test] fn test_plural_rules() { diff --git a/components/pluralrules/tests/rules.rs b/components/plurals/tests/rules.rs similarity index 89% rename from components/pluralrules/tests/rules.rs rename to components/plurals/tests/rules.rs index 29246531664..f5364d7ca3c 100644 --- a/components/pluralrules/tests/rules.rs +++ b/components/plurals/tests/rules.rs @@ -1,8 +1,8 @@ mod fixtures; mod helpers; -use icu_pluralrules::rules::{parse, parse_condition, test_condition, Lexer}; -use icu_pluralrules::PluralOperands; +use icu_plurals::rules::{parse, parse_condition, test_condition, Lexer}; +use icu_plurals::PluralOperands; #[test] fn test_parsing_operands() { diff --git a/components/uniset/Cargo.toml b/components/uniset/Cargo.toml index a08f608ac87..a11c7ee90c3 100644 --- a/components/uniset/Cargo.toml +++ b/components/uniset/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "icu-unicodeset" +name = "icu-uniset" description = "API for managing Unicode Language and Locale Identifiers" version = "0.0.1" authors = ["The ICU4X Project Developers"] @@ -21,4 +21,4 @@ bench = false [[bench]] name = "inv_list" -harness = false \ No newline at end of file +harness = false diff --git a/components/uniset/benches/inv_list.rs b/components/uniset/benches/inv_list.rs index 31dacb530ee..92fe2cce314 100644 --- a/components/uniset/benches/inv_list.rs +++ b/components/uniset/benches/inv_list.rs @@ -1,5 +1,5 @@ use criterion::{criterion_group, criterion_main, Criterion}; -use icu_unicodeset::UnicodeSet; +use icu_uniset::UnicodeSet; use std::char; fn contains_bench(c: &mut Criterion) { diff --git a/components/uniset/examples/unicode_bmp_blocks_selector.rs b/components/uniset/examples/unicode_bmp_blocks_selector.rs index f52e85980e8..18009945049 100644 --- a/components/uniset/examples/unicode_bmp_blocks_selector.rs +++ b/components/uniset/examples/unicode_bmp_blocks_selector.rs @@ -7,7 +7,7 @@ // // This is a simple example of the API use and is severely oversimplified // compared to real Unicode block selection. -use icu_unicodeset::{UnicodeSet, UnicodeSetBuilder}; +use icu_uniset::{UnicodeSet, UnicodeSetBuilder}; fn get_basic_latin_block() -> UnicodeSet { let mut builder = UnicodeSetBuilder::new(); diff --git a/components/uniset/src/builder.rs b/components/uniset/src/builder.rs index cba2dca06e1..06f092ce835 100644 --- a/components/uniset/src/builder.rs +++ b/components/uniset/src/builder.rs @@ -77,7 +77,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_char('a'); /// let check = builder.build(); @@ -93,7 +93,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_range(&('A'..='Z')); /// let check = builder.build(); @@ -109,7 +109,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::{UnicodeSet, UnicodeSetBuilder}; + /// use icu_uniset::{UnicodeSet, UnicodeSetBuilder}; /// let mut builder = UnicodeSetBuilder::new(); /// let set = UnicodeSet::from_inversion_list(vec![65, 76]).unwrap(); /// builder.add_set(&set); @@ -144,7 +144,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_range(&('A'..='Z')); /// builder.remove_char('A'); @@ -160,7 +160,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_range(&('A'..='Z')); /// builder.remove_range(&('A'..='C')); @@ -176,7 +176,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::{UnicodeSet, UnicodeSetBuilder}; + /// use icu_uniset::{UnicodeSet, UnicodeSetBuilder}; /// let mut builder = UnicodeSetBuilder::new(); /// let set = UnicodeSet::from_inversion_list(vec![65, 70]).unwrap(); /// builder.add_range(&('A'..='Z')); @@ -194,7 +194,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_range(&('A'..='Z')); /// builder.retain_char('A'); @@ -214,7 +214,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_range(&('A'..='Z')); /// builder.retain_range(&('A'..='B')); @@ -235,7 +235,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::{UnicodeSetBuilder, UnicodeSet}; + /// use icu_uniset::{UnicodeSetBuilder, UnicodeSet}; /// let mut builder = UnicodeSetBuilder::new(); /// let set = UnicodeSet::from_inversion_list(vec![65, 70]).unwrap(); /// builder.add_range(&('A'..='Z')); @@ -297,7 +297,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::{UnicodeSetBuilder, UnicodeSet}; + /// use icu_uniset::{UnicodeSetBuilder, UnicodeSet}; /// let mut builder = UnicodeSetBuilder::new(); /// let set = UnicodeSet::from_inversion_list(vec![0, 65, 70, (std::char::MAX as u32) + 1]).unwrap(); /// builder.add_set(&set); @@ -325,7 +325,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_range(&('A'..='D')); /// builder.complement_char('A'); @@ -346,7 +346,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSetBuilder; + /// use icu_uniset::UnicodeSetBuilder; /// let mut builder = UnicodeSetBuilder::new(); /// builder.add_range(&('A'..='D')); /// builder.complement_range(&('C'..='F')); @@ -366,7 +366,7 @@ impl UnicodeSetBuilder { /// # Example: /// /// ``` - /// use icu_unicodeset::{UnicodeSetBuilder, UnicodeSet}; + /// use icu_uniset::{UnicodeSetBuilder, UnicodeSet}; /// let mut builder = UnicodeSetBuilder::new(); /// let set = UnicodeSet::from_inversion_list(vec![65, 70, 75, 90]).unwrap(); /// builder.add_range(&('C'..='N')); // 67 - 78 diff --git a/components/uniset/src/lib.rs b/components/uniset/src/lib.rs index 762ecde5723..dae9358e41d 100644 --- a/components/uniset/src/lib.rs +++ b/components/uniset/src/lib.rs @@ -18,12 +18,12 @@ //! the [`UnicodeSetBuilder`](struct.UnicodeSetBuilder.html), or from the TBA Properties API. //! //! ``` -//! use icu_unicodeset::UnicodeSet; +//! use icu_uniset::UnicodeSet; //! let inv_list = vec![65, 70]; // 'A'..'F' //! let set = UnicodeSet::from_inversion_list(inv_list); //! assert!(set.is_ok()); //! -//! use icu_unicodeset::UnicodeSetBuilder; +//! use icu_uniset::UnicodeSetBuilder; //! let mut builder = UnicodeSetBuilder::new(); //! builder.add_range(&('A'..'Z')); //! let set: UnicodeSet = builder.build(); @@ -35,7 +35,7 @@ //! Currently, you can check if a character/range of characters exists in the UnicodeSet, or iterate through the characters. //! //! ``` -//! use icu_unicodeset::UnicodeSet; +//! use icu_uniset::UnicodeSet; //! let inv_list = vec![65, 70]; // 'A'..'F' //! let set = UnicodeSet::from_inversion_list(inv_list).unwrap(); //! assert!(set.contains('A')); diff --git a/components/uniset/src/uniset.rs b/components/uniset/src/uniset.rs index 89b45eaa894..41fe30ede5d 100644 --- a/components/uniset/src/uniset.rs +++ b/components/uniset/src/uniset.rs @@ -30,8 +30,8 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; - /// use icu_unicodeset::UnicodeSetError; + /// use icu_uniset::UnicodeSet; + /// use icu_uniset::UnicodeSetError; /// let empty: Vec = vec![]; /// assert_eq!(UnicodeSet::from_inversion_list(empty.clone()), Err(UnicodeSetError::InvalidSet(empty.clone()))) /// ``` @@ -79,7 +79,7 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; + /// use icu_uniset::UnicodeSet; /// let example_list = vec![65, 68, 69, 70]; /// let example = UnicodeSet::from_inversion_list(example_list).unwrap(); /// let mut example_iter = example.iter(); @@ -140,7 +140,7 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; + /// use icu_uniset::UnicodeSet; /// let example_list = vec![65, 67, 68, 69]; /// let example = UnicodeSet::from_inversion_list(example_list).unwrap(); /// assert!(example.contains('A')); @@ -159,7 +159,7 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; + /// use icu_uniset::UnicodeSet; /// let example_list = vec![65, 67, 68, 69]; /// let example = UnicodeSet::from_inversion_list(example_list).unwrap(); /// assert!(example.contains_range(&('A'..'C'))); @@ -173,7 +173,7 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; + /// use icu_uniset::UnicodeSet; /// use std::char; /// let check = char::from_u32(0xD7FE).unwrap() .. char::from_u32(0xE001).unwrap(); /// let example_list = vec![0xD7FE, 0xD7FF, 0xE000, 0xE001]; @@ -196,7 +196,7 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; + /// use icu_uniset::UnicodeSet; /// let example_list = vec![65, 70, 85, 91]; // A - E, U - Z /// let example = UnicodeSet::from_inversion_list(example_list).unwrap(); /// let a_to_d = UnicodeSet::from_inversion_list(vec![65, 69]).unwrap(); @@ -231,7 +231,7 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; + /// use icu_uniset::UnicodeSet; /// let example_list = vec![65, 68]; // {A, B, C} /// let example = UnicodeSet::from_inversion_list(example_list).unwrap(); /// assert_eq!(example.span("CABXYZ", true), 3); @@ -252,7 +252,7 @@ impl UnicodeSet { /// # Example: /// /// ``` - /// use icu_unicodeset::UnicodeSet; + /// use icu_uniset::UnicodeSet; /// let example_list = vec![65, 68]; // {A, B, C} /// let example = UnicodeSet::from_inversion_list(example_list).unwrap(); /// assert_eq!(example.span_back("XYZCAB", true), 3); diff --git a/docs/style-guide.md b/docs/style-guide.md index d2f72c596d1..4089369766d 100644 --- a/docs/style-guide.md +++ b/docs/style-guide.md @@ -111,7 +111,7 @@ their type. | Package | Crate | Standalone Import | ICU Meta-package | |----|----|----|----| | locale | `icu-locale` | `use icu_locale::Locale` | `use icu::Locale` | -| pluralrules | `icu-pluralrules` | `use icu_pluralrules::PluralRules` | `use icu::PluralRules` | +| plurals | `icu-plurals` | `use icu_plurals::PluralRules` | `use icu::PluralRules` | | datetime | `icu-datetime` | `use icu_datetime::DateTimeFormat` | `use icu::DateTimeFormat` | | datetime | `icu-datetime` | `use icu_datetime::skeleton::SkeletonField` | `use icu::datetime::skeleton::SkeletonField` |