decasify 0.6.1__tar.gz → 0.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -271,7 +271,7 @@ dependencies = [
271
271
 
272
272
  [[package]]
273
273
  name = "decasify"
274
- version = "0.6.1"
274
+ version = "0.7.0"
275
275
  dependencies = [
276
276
  "assert_cmd",
277
277
  "clap",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "decasify"
3
- version = "0.6.1"
3
+ version = "0.7.0"
4
4
  authors = ["Caleb Maclennan <caleb@alerque.com>"]
5
5
  edition = "2021"
6
6
  rust-version = "1.73.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: decasify
3
- Version: 0.6.1
3
+ Version: 0.7.0
4
4
  Classifier: Development Status :: 5 - Production/Stable
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: Natural Language :: English
@@ -123,21 +123,21 @@ In your `Cargo.toml` file.
123
123
 
124
124
  ```toml
125
125
  [dependencies]
126
- decasify = "0.6"
126
+ decasify = "0.7"
127
127
  ```
128
128
 
129
129
  Then use the crate functions and types in your project something like this:
130
130
 
131
131
  ```rust
132
132
  use decasify::to_titlecase;
133
- use decasify::{InputLocale, StyleGuide};
133
+ use decasify::{Locale, StyleGuide};
134
134
 
135
135
  fn demo() {
136
136
  let input = "ILIK SU VE İTEN RÜZGARLAR";
137
- let output = to_titlecase(input, InputLocale::TR, None);
137
+ let output = to_titlecase(input, Locale::TR, StyleGuide::LanguageDefault);
138
138
  eprintln! {"{output}"};
139
139
  let input = "title with a twist: a colon";
140
- let output = to_titlecase(input, InputLocale::EN, Some(StyleGuide::DaringFireball));
140
+ let output = to_titlecase(input, Locale::EN, StyleGuide::DaringFireball);
141
141
  eprintln! {"{output}"};
142
142
  }
143
143
  ```
@@ -181,10 +181,10 @@ Then import and use the provided functions and type classes:
181
181
  from decasify import *
182
182
 
183
183
  input = "ILIK SU VE İTEN RÜZGARLAR"
184
- output = titlecase(input, InputLocale.TR)
184
+ output = titlecase(input, Locale.TR)
185
185
  print(output)
186
186
  input = "title with a twist: a colon"
187
- output = titlecase(input, InputLocale.EN, StyleGuide.DaringFireball)
187
+ output = titlecase(input, Locale.EN, StyleGuide.DaringFireball)
188
188
  print(output)
189
189
  ```
190
190
 
@@ -195,14 +195,14 @@ Depend on the WASM based JavaScript module in your project with `npm add decasif
195
195
  Then import and use the provided functions and classes:
196
196
 
197
197
  ```javascript
198
- import { titlecase, uppercase, lowercase, InputLocale, StyleGuide } from 'decasify';
198
+ import { titlecase, uppercase, lowercase, Locale, StyleGuide } from 'decasify';
199
199
 
200
200
  var input = "ILIK SU VE İTEN RÜZGARLAR"
201
- var output = titlecase(input, InputLocale.TR)
201
+ var output = titlecase(input, Locale.TR)
202
202
  console.log(output)
203
203
 
204
204
  var input = "title with a twist: a colon"
205
- var output = titlecase(input, InputLocale.EN, StyleGuide.DaringFireball)
205
+ var output = titlecase(input, Locale.EN, StyleGuide.DaringFireball)
206
206
  console.log(output)
207
207
  ```
208
208
 
@@ -101,21 +101,21 @@ In your `Cargo.toml` file.
101
101
 
102
102
  ```toml
103
103
  [dependencies]
104
- decasify = "0.6"
104
+ decasify = "0.7"
105
105
  ```
106
106
 
107
107
  Then use the crate functions and types in your project something like this:
108
108
 
109
109
  ```rust
110
110
  use decasify::to_titlecase;
111
- use decasify::{InputLocale, StyleGuide};
111
+ use decasify::{Locale, StyleGuide};
112
112
 
113
113
  fn demo() {
114
114
  let input = "ILIK SU VE İTEN RÜZGARLAR";
115
- let output = to_titlecase(input, InputLocale::TR, None);
115
+ let output = to_titlecase(input, Locale::TR, StyleGuide::LanguageDefault);
116
116
  eprintln! {"{output}"};
117
117
  let input = "title with a twist: a colon";
118
- let output = to_titlecase(input, InputLocale::EN, Some(StyleGuide::DaringFireball));
118
+ let output = to_titlecase(input, Locale::EN, StyleGuide::DaringFireball);
119
119
  eprintln! {"{output}"};
120
120
  }
121
121
  ```
@@ -159,10 +159,10 @@ Then import and use the provided functions and type classes:
159
159
  from decasify import *
160
160
 
161
161
  input = "ILIK SU VE İTEN RÜZGARLAR"
162
- output = titlecase(input, InputLocale.TR)
162
+ output = titlecase(input, Locale.TR)
163
163
  print(output)
164
164
  input = "title with a twist: a colon"
165
- output = titlecase(input, InputLocale.EN, StyleGuide.DaringFireball)
165
+ output = titlecase(input, Locale.EN, StyleGuide.DaringFireball)
166
166
  print(output)
167
167
  ```
168
168
 
@@ -173,14 +173,14 @@ Depend on the WASM based JavaScript module in your project with `npm add decasif
173
173
  Then import and use the provided functions and classes:
174
174
 
175
175
  ```javascript
176
- import { titlecase, uppercase, lowercase, InputLocale, StyleGuide } from 'decasify';
176
+ import { titlecase, uppercase, lowercase, Locale, StyleGuide } from 'decasify';
177
177
 
178
178
  var input = "ILIK SU VE İTEN RÜZGARLAR"
179
- var output = titlecase(input, InputLocale.TR)
179
+ var output = titlecase(input, Locale.TR)
180
180
  console.log(output)
181
181
 
182
182
  var input = "title with a twist: a colon"
183
- var output = titlecase(input, InputLocale.EN, StyleGuide.DaringFireball)
183
+ var output = titlecase(input, Locale.EN, StyleGuide.DaringFireball)
184
184
  console.log(output)
185
185
  ```
186
186
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  use decasify::cli::Cli;
5
5
  use decasify::{to_lowercase, to_sentencecase, to_titlecase, to_uppercase};
6
- use decasify::{InputLocale, Result, StyleGuide, TargetCase};
6
+ use decasify::{Case, Locale, Result, StyleGuide};
7
7
 
8
8
  use clap::CommandFactory;
9
9
  use std::io;
@@ -13,9 +13,9 @@ fn main() -> Result<()> {
13
13
  let version = option_env!("VERGEN_GIT_DESCRIBE").unwrap_or_else(|| env!("CARGO_PKG_VERSION"));
14
14
  let app = Cli::command().version(version);
15
15
  let matches = app.get_matches();
16
- let locale = matches.get_one::<InputLocale>("locale").unwrap();
17
- let case = matches.get_one::<TargetCase>("case").unwrap().to_owned();
18
- let style = matches.get_one::<StyleGuide>("style").map(|s| s.to_owned());
16
+ let locale = matches.get_one::<Locale>("locale").unwrap();
17
+ let case = matches.get_one::<Case>("case").unwrap().to_owned();
18
+ let style = matches.get_one::<StyleGuide>("style").unwrap().to_owned();
19
19
  match matches.contains_id("input") {
20
20
  true => {
21
21
  let input: Vec<String> = matches
@@ -38,16 +38,17 @@ fn main() -> Result<()> {
38
38
 
39
39
  fn process<I: IntoIterator<Item = String>>(
40
40
  strings: I,
41
- locale: InputLocale,
42
- case: TargetCase,
43
- style: Option<StyleGuide>,
41
+ locale: Locale,
42
+ case: Case,
43
+ style: StyleGuide,
44
44
  ) {
45
45
  for string in strings {
46
46
  let output = match case {
47
- TargetCase::Title => to_titlecase(string, locale, style),
48
- TargetCase::Lower => to_lowercase(string, locale),
49
- TargetCase::Upper => to_uppercase(string, locale),
50
- TargetCase::Sentence => to_sentencecase(string, locale),
47
+ Case::Title => to_titlecase(string, locale, style),
48
+ Case::Lower => to_lowercase(string, locale),
49
+ Case::Upper => to_uppercase(string, locale),
50
+ Case::Sentence => to_sentencecase(string, locale),
51
+ _ => unreachable!(),
51
52
  };
52
53
  println!("{output}")
53
54
  }
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: LGPL-3.0-only
3
3
 
4
4
  #[cfg(build)]
5
- use crate::{InputLocale, StyleGuide, TargetCase};
5
+ use crate::{Case, Locale, StyleGuide};
6
6
 
7
7
  use clap::{builder, Parser};
8
8
  use strum::VariantNames;
@@ -21,16 +21,16 @@ macro_rules! clap_enum_variants {
21
21
  #[clap(author, bin_name = "decasify")]
22
22
  pub struct Cli {
23
23
  /// Locale
24
- #[clap(short, long, default_value_t, ignore_case = true, value_parser = clap_enum_variants!(InputLocale))]
25
- pub locale: InputLocale,
24
+ #[clap(short, long, default_value_t, ignore_case = true, value_parser = clap_enum_variants!(Locale))]
25
+ pub locale: Locale,
26
26
 
27
27
  /// Target case
28
- #[clap(short, long, default_value_t, ignore_case = true, value_parser = clap_enum_variants!(TargetCase))]
29
- pub case: TargetCase,
28
+ #[clap(short, long, default_value_t, ignore_case = true, value_parser = clap_enum_variants!(Case))]
29
+ pub case: Case,
30
30
 
31
31
  /// Style Guide
32
- #[clap(short, long, ignore_case = true, value_parser = clap_enum_variants!(StyleGuide))]
33
- pub style: Option<StyleGuide>,
32
+ #[clap(short, long, default_value_t, ignore_case = true, value_parser = clap_enum_variants!(StyleGuide))]
33
+ pub style: StyleGuide,
34
34
 
35
35
  /// Input string
36
36
  pub input: Vec<String>,
@@ -6,20 +6,22 @@ use regex::Regex;
6
6
  use std::{borrow::Cow, error, fmt, fmt::Display, str::FromStr};
7
7
 
8
8
  #[derive(Clone, Debug, PartialEq)]
9
+ #[non_exhaustive]
9
10
  pub enum Segment {
10
11
  Separator(String),
11
12
  Word(String),
12
13
  }
13
14
 
14
15
  #[derive(Debug, Clone)]
16
+ #[non_exhaustive]
15
17
  pub struct Chunk {
16
18
  pub segments: Vec<Segment>,
17
19
  }
18
20
 
19
- fn split_chunk(src: &str) -> Chunk {
21
+ fn split_chunk(s: &str) -> Chunk {
20
22
  let mut segments: Vec<Segment> = Vec::new();
21
23
  let captures = Regex::new(r"(?<separator>\p{Whitespace}+)|(?<word>\P{Whitespace}+)").unwrap();
22
- for capture in captures.captures_iter(src) {
24
+ for capture in captures.captures_iter(s) {
23
25
  if let Some(m) = capture.name("separator") {
24
26
  segments.push(Segment::Separator(m.as_str().to_string()));
25
27
  } else if let Some(m) = capture.name("word") {
@@ -30,33 +32,33 @@ fn split_chunk(src: &str) -> Chunk {
30
32
  }
31
33
 
32
34
  impl From<String> for Chunk {
33
- fn from(src: String) -> Self {
34
- split_chunk(src.as_ref())
35
+ fn from(s: String) -> Self {
36
+ split_chunk(s.as_ref())
35
37
  }
36
38
  }
37
39
 
38
40
  impl From<&String> for Chunk {
39
- fn from(src: &String) -> Self {
40
- split_chunk(src.as_ref())
41
+ fn from(s: &String) -> Self {
42
+ split_chunk(s.as_ref())
41
43
  }
42
44
  }
43
45
 
44
46
  impl From<&str> for Chunk {
45
- fn from(src: &str) -> Self {
46
- split_chunk(src)
47
+ fn from(s: &str) -> Self {
48
+ split_chunk(s)
47
49
  }
48
50
  }
49
51
 
50
52
  impl From<&Cow<'_, str>> for Chunk {
51
- fn from(src: &Cow<'_, str>) -> Self {
52
- split_chunk(src)
53
+ fn from(s: &Cow<'_, str>) -> Self {
54
+ split_chunk(s)
53
55
  }
54
56
  }
55
57
 
56
58
  impl FromStr for Chunk {
57
59
  type Err = Box<dyn error::Error>;
58
- fn from_str(src: &str) -> Result<Self> {
59
- Ok(split_chunk(src))
60
+ fn from_str(s: &str) -> Result<Self> {
61
+ Ok(split_chunk(s))
60
62
  }
61
63
  }
62
64
 
@@ -12,7 +12,7 @@ pub mod content;
12
12
  pub mod types;
13
13
 
14
14
  pub use content::{Chunk, Segment};
15
- pub use types::{InputLocale, Result, StyleGuide, TargetCase};
15
+ pub use types::{Case, Locale, Result, StyleGuide};
16
16
 
17
17
  #[cfg(feature = "cli")]
18
18
  pub mod cli;
@@ -29,52 +29,54 @@ pub mod wasm;
29
29
  /// Convert a string to title case following typesetting conventions for a target locale
30
30
  pub fn to_titlecase(
31
31
  chunk: impl Into<Chunk>,
32
- locale: InputLocale,
33
- style: Option<StyleGuide>,
32
+ locale: impl Into<Locale>,
33
+ style: impl Into<StyleGuide>,
34
34
  ) -> String {
35
35
  let chunk: Chunk = chunk.into();
36
+ let locale: Locale = locale.into();
37
+ let style: StyleGuide = style.into();
36
38
  match locale {
37
- InputLocale::EN => to_titlecase_en(chunk, style),
38
- InputLocale::TR => to_titlecase_tr(chunk, style),
39
+ Locale::EN => to_titlecase_en(chunk, style),
40
+ Locale::TR => to_titlecase_tr(chunk, style),
39
41
  }
40
42
  }
41
43
 
42
44
  /// Convert a string to lower case following typesetting conventions for a target locale
43
- pub fn to_lowercase(chunk: impl Into<Chunk>, locale: impl Into<InputLocale>) -> String {
45
+ pub fn to_lowercase(chunk: impl Into<Chunk>, locale: impl Into<Locale>) -> String {
44
46
  let chunk: Chunk = chunk.into();
45
- let locale: InputLocale = locale.into();
47
+ let locale: Locale = locale.into();
46
48
  match locale {
47
- InputLocale::EN => to_lowercase_en(chunk),
48
- InputLocale::TR => to_lowercase_tr(chunk),
49
+ Locale::EN => to_lowercase_en(chunk),
50
+ Locale::TR => to_lowercase_tr(chunk),
49
51
  }
50
52
  }
51
53
 
52
54
  /// Convert a string to upper case following typesetting conventions for a target locale
53
- pub fn to_uppercase(chunk: impl Into<Chunk>, locale: impl Into<InputLocale>) -> String {
55
+ pub fn to_uppercase(chunk: impl Into<Chunk>, locale: impl Into<Locale>) -> String {
54
56
  let chunk: Chunk = chunk.into();
55
- let locale: InputLocale = locale.into();
57
+ let locale: Locale = locale.into();
56
58
  match locale {
57
- InputLocale::EN => to_uppercase_en(chunk),
58
- InputLocale::TR => to_uppercase_tr(chunk),
59
+ Locale::EN => to_uppercase_en(chunk),
60
+ Locale::TR => to_uppercase_tr(chunk),
59
61
  }
60
62
  }
61
63
 
62
64
  /// Convert a string to sentence case following typesetting conventions for a target locale
63
- pub fn to_sentencecase(chunk: impl Into<Chunk>, locale: impl Into<InputLocale>) -> String {
65
+ pub fn to_sentencecase(chunk: impl Into<Chunk>, locale: impl Into<Locale>) -> String {
64
66
  let chunk: Chunk = chunk.into();
65
- let locale: InputLocale = locale.into();
67
+ let locale: Locale = locale.into();
66
68
  match locale {
67
- InputLocale::EN => to_sentencecase_en(chunk),
68
- InputLocale::TR => to_sentencecase_tr(chunk),
69
+ Locale::EN => to_sentencecase_en(chunk),
70
+ Locale::TR => to_sentencecase_tr(chunk),
69
71
  }
70
72
  }
71
73
 
72
- fn to_titlecase_en(chunk: Chunk, style: Option<StyleGuide>) -> String {
74
+ fn to_titlecase_en(chunk: Chunk, style: StyleGuide) -> String {
73
75
  match style {
74
- Some(StyleGuide::AssociatedPress) => to_titlecase_ap(chunk),
75
- Some(StyleGuide::ChicagoManualOfStyle) => to_titlecase_cmos(chunk),
76
- Some(StyleGuide::DaringFireball) => to_titlecase_gruber(chunk),
77
- None => to_titlecase_gruber(chunk),
76
+ StyleGuide::AssociatedPress => to_titlecase_ap(chunk),
77
+ StyleGuide::ChicagoManualOfStyle => to_titlecase_cmos(chunk),
78
+ StyleGuide::DaringFireball => to_titlecase_gruber(chunk),
79
+ StyleGuide::LanguageDefault => to_titlecase_gruber(chunk),
78
80
  }
79
81
  }
80
82
 
@@ -125,10 +127,9 @@ fn to_titlecase_gruber(chunk: Chunk) -> String {
125
127
  format!("{}{}{}", leading_trivia, titilized, trailing_trivia)
126
128
  }
127
129
 
128
- fn to_titlecase_tr(chunk: Chunk, style: Option<StyleGuide>) -> String {
130
+ fn to_titlecase_tr(chunk: Chunk, style: StyleGuide) -> String {
129
131
  match style {
130
- Some(_) => todo!("Turkish implementation doesn't support different style guides."),
131
- None => {
132
+ StyleGuide::LanguageDefault => {
132
133
  let mut chunk = chunk.clone();
133
134
  let mut done_first = false;
134
135
  chunk.segments.iter_mut().for_each(|segment| {
@@ -146,6 +147,7 @@ fn to_titlecase_tr(chunk: Chunk, style: Option<StyleGuide>) -> String {
146
147
  });
147
148
  chunk.to_string()
148
149
  }
150
+ _ => todo!("Turkish implementation doesn't support different style guides."),
149
151
  }
150
152
  }
151
153
 
@@ -244,6 +246,24 @@ fn to_sentencecase_tr(chunk: Chunk) -> String {
244
246
  mod tests {
245
247
  use super::*;
246
248
 
249
+ #[test]
250
+ fn cast_from_str() {
251
+ let res = to_titlecase("FIST", "en", "gruber");
252
+ assert_eq!(res, "Fist");
253
+ let res = to_titlecase("FIST", "tr", "");
254
+ assert_eq!(res, "Fıst");
255
+ let res = to_titlecase("FIST", "tr", "default");
256
+ assert_eq!(res, "Fıst");
257
+ }
258
+
259
+ #[test]
260
+ fn cast_from_legacy_option() {
261
+ let res = to_titlecase("FIST", "en", Some(StyleGuide::DaringFireball));
262
+ assert_eq!(res, "Fist");
263
+ let res = to_titlecase("FIST", "en", None);
264
+ assert_eq!(res, "Fist");
265
+ }
266
+
247
267
  macro_rules! titlecase {
248
268
  ($name:ident, $locale:expr, $style:expr, $input:expr, $expected:expr) => {
249
269
  #[test]
@@ -254,116 +274,122 @@ mod tests {
254
274
  };
255
275
  }
256
276
 
257
- titlecase!(abc_none, InputLocale::EN, None, "a b c", "A B C");
277
+ titlecase!(
278
+ abc_none,
279
+ Locale::EN,
280
+ StyleGuide::LanguageDefault,
281
+ "a b c",
282
+ "A B C"
283
+ );
258
284
 
259
285
  titlecase!(
260
286
  abc_cmos,
261
- InputLocale::EN,
262
- Some(StyleGuide::ChicagoManualOfStyle),
287
+ Locale::EN,
288
+ StyleGuide::ChicagoManualOfStyle,
263
289
  "a b c",
264
290
  "A B C"
265
291
  );
266
292
 
267
293
  titlecase!(
268
294
  abc_gruber,
269
- InputLocale::EN,
270
- Some(StyleGuide::DaringFireball),
295
+ Locale::EN,
296
+ StyleGuide::DaringFireball,
271
297
  "a b c",
272
298
  "A B C"
273
299
  );
274
300
 
275
301
  titlecase!(
276
302
  simple_cmos,
277
- InputLocale::EN,
278
- Some(StyleGuide::ChicagoManualOfStyle),
303
+ Locale::EN,
304
+ StyleGuide::ChicagoManualOfStyle,
279
305
  "Once UPON A time",
280
306
  "Once upon a Time"
281
307
  );
282
308
 
283
309
  titlecase!(
284
310
  simple_gruber,
285
- InputLocale::EN,
286
- Some(StyleGuide::DaringFireball),
311
+ Locale::EN,
312
+ StyleGuide::DaringFireball,
287
313
  "Once UPON A time",
288
314
  "Once UPON a Time"
289
315
  );
290
316
 
291
317
  titlecase!(
292
318
  colon_cmos,
293
- InputLocale::EN,
294
- Some(StyleGuide::ChicagoManualOfStyle),
319
+ Locale::EN,
320
+ StyleGuide::ChicagoManualOfStyle,
295
321
  "foo: a baz",
296
322
  "Foo: a Baz"
297
323
  );
298
324
 
299
325
  titlecase!(
300
326
  colon_gruber,
301
- InputLocale::EN,
302
- Some(StyleGuide::DaringFireball),
327
+ Locale::EN,
328
+ StyleGuide::DaringFireball,
303
329
  "foo: a baz",
304
330
  "Foo: A Baz"
305
331
  );
306
332
 
307
333
  // titlecase!(
308
334
  // qna_cmos,
309
- // InputLocale::EN,
310
- // Some(StyleGuide::ChicagoManualOfStyle),
335
+ // Locale::EN,
336
+ // StyleGuide::ChicagoManualOfStyle,
311
337
  // "Q&A with Steve Jobs: 'That's what happens in technology'",
312
338
  // "Q&a with Steve Jobs: 'that's What Happens in Technology'"
313
339
  // );
314
340
 
315
341
  titlecase!(
316
342
  qna_gruber,
317
- InputLocale::EN,
318
- Some(StyleGuide::DaringFireball),
343
+ Locale::EN,
344
+ StyleGuide::DaringFireball,
319
345
  "Q&A with Steve Jobs: 'That's what happens in technology'",
320
346
  "Q&A With Steve Jobs: 'That's What Happens in Technology'"
321
347
  );
322
348
 
323
349
  titlecase!(
324
350
  ws_gruber,
325
- InputLocale::EN,
326
- Some(StyleGuide::DaringFireball),
351
+ Locale::EN,
352
+ StyleGuide::DaringFireball,
327
353
  " free trolling\n space ",
328
354
  " Free Trolling\n Space "
329
355
  );
330
356
 
331
357
  titlecase!(
332
358
  turkish_question,
333
- InputLocale::TR,
334
- None,
359
+ Locale::TR,
360
+ StyleGuide::LanguageDefault,
335
361
  "aç mısın",
336
362
  "Aç mısın"
337
363
  );
338
364
 
339
365
  titlecase!(
340
366
  turkish_question_false,
341
- InputLocale::TR,
342
- None,
367
+ Locale::TR,
368
+ StyleGuide::LanguageDefault,
343
369
  "dualarımızda minnettarlık",
344
370
  "Dualarımızda Minnettarlık"
345
371
  );
346
372
 
347
373
  titlecase!(
348
374
  turkish_chars,
349
- InputLocale::TR,
350
- None,
375
+ Locale::TR,
376
+ StyleGuide::LanguageDefault,
351
377
  "İLKİ ILIK ÖĞLEN",
352
378
  "İlki Ilık Öğlen"
353
379
  );
354
380
 
355
381
  titlecase!(
356
382
  turkish_blockwords,
357
- InputLocale::TR,
358
- None,
383
+ Locale::TR,
384
+ StyleGuide::LanguageDefault,
359
385
  "Sen VE ben ile o",
360
386
  "Sen ve Ben ile O"
361
387
  );
362
388
 
363
389
  titlecase!(
364
390
  turkish_ws,
365
- InputLocale::TR,
366
- None,
391
+ Locale::TR,
392
+ StyleGuide::LanguageDefault,
367
393
  " serbest serseri\n boşluk ",
368
394
  " Serbest Serseri\n Boşluk "
369
395
  );
@@ -378,16 +404,11 @@ mod tests {
378
404
  };
379
405
  }
380
406
 
381
- lowercase!(
382
- lower_en,
383
- InputLocale::EN,
384
- "foo BAR BaZ BIKE",
385
- "foo bar baz bike"
386
- );
407
+ lowercase!(lower_en, Locale::EN, "foo BAR BaZ BIKE", "foo bar baz bike");
387
408
 
388
409
  lowercase!(
389
410
  lower_tr,
390
- InputLocale::TR,
411
+ Locale::TR,
391
412
  "foo BAR BaZ ILIK İLE",
392
413
  "foo bar baz ılık ile"
393
414
  );
@@ -402,16 +423,11 @@ mod tests {
402
423
  };
403
424
  }
404
425
 
405
- uppercase!(
406
- upper_en,
407
- InputLocale::EN,
408
- "foo BAR BaZ bike",
409
- "FOO BAR BAZ BIKE"
410
- );
426
+ uppercase!(upper_en, Locale::EN, "foo BAR BaZ bike", "FOO BAR BAZ BIKE");
411
427
 
412
428
  uppercase!(
413
429
  upper_tr,
414
- InputLocale::TR,
430
+ Locale::TR,
415
431
  "foo BAR BaZ ILIK İLE",
416
432
  "FOO BAR BAZ ILIK İLE"
417
433
  );
@@ -428,15 +444,10 @@ mod tests {
428
444
 
429
445
  sentencecase!(
430
446
  sentence_en,
431
- InputLocale::EN,
447
+ Locale::EN,
432
448
  "insert BIKE here",
433
449
  "Insert bike here"
434
450
  );
435
451
 
436
- sentencecase!(
437
- sentence_tr,
438
- InputLocale::TR,
439
- "ilk DAVRANSIN",
440
- "İlk davransın"
441
- );
452
+ sentencecase!(sentence_tr, Locale::TR, "ilk DAVRANSIN", "İlk davransın");
442
453
  }