Skip to content
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

fix some typos #1329

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Humanizer.Tests.Shared/Bytes/ByteRateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void FormattedTimeUnitTests(long bytes, int measurementIntervalSeconds, T
[InlineData(TimeUnit.Month)]
[InlineData(TimeUnit.Week)]
[InlineData(TimeUnit.Year)]
public void ThowsOnUnsupportedData(TimeUnit units)
public void ThrowsOnUnsupportedData(TimeUnit units)
{
var dummyRate = ByteSize.FromBits(1).Per(TimeSpan.FromSeconds(1));

Expand Down
8 changes: 4 additions & 4 deletions src/Humanizer.Tests.Shared/InflectorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ public void SingularizeSingleLetter(string input)
[InlineData("some-title: The beginning", "Some Title: The Beginning")]
[InlineData("some_title:_the_beginning", "Some Title: the Beginning")]
[InlineData("some title: The_beginning", "Some Title: The Beginning")]
public void Titleize(string input, string expectedOuput)
public void Titleize(string input, string expectedOutput)
{
Assert.Equal(expectedOuput, input.Titleize());
Assert.Equal(expectedOutput, input.Titleize());
}

[InlineData("some_title", "some-title")]
Expand Down Expand Up @@ -157,9 +157,9 @@ public void Camelize(string input, string expectedOutput)
[InlineData("SomeTitleThatWillBeUnderscored", "some_title_that_will_be_underscored")]
[InlineData("SomeForeignWordsLikeÄgyptenÑu", "some_foreign_words_like_ägypten_ñu")]
[InlineData("Some wordsTo be Underscored", "some_words_to_be_underscored")]
public void Underscore(string input, string expectedOuput)
public void Underscore(string input, string expectedOutput)
{
Assert.Equal(expectedOuput, input.Underscore());
Assert.Equal(expectedOutput, input.Underscore());
}

// transform words into lowercase and separate with a -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void FormattedTimeUnitTests(long bytes, int measurementIntervalSeconds, T
[InlineData(TimeUnit.Month)]
[InlineData(TimeUnit.Week)]
[InlineData(TimeUnit.Year)]
public void ThowsOnUnsupportedData(TimeUnit units)
public void ThrowsOnUnsupportedData(TimeUnit units)
{
var dummyRate = ByteSize.FromBits(1).Per(TimeSpan.FromSeconds(1));

Expand Down
4 changes: 2 additions & 2 deletions src/Humanizer.Tests.Shared/StringHumanizeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public void CanHumanizeOtherUnicodeLetter(string input, string expectedResult)
[InlineData("TEST 1 _ THIS IS A TEST", "TEST 1 THIS IS A TEST")]
[InlineData("TEST 1 - THIS_IS_A_TEST", "TEST 1 THIS IS A TEST")]
[InlineData("TEST 1 - THIS is A Test", "TEST 1 THIS is A test")]
public void CanHumanizeStringWithUnderscoresAndDashes(string input, string expectedReseult)
public void CanHumanizeStringWithUnderscoresAndDashes(string input, string expectedResult)
{
Assert.Equal(expectedReseult, input.Humanize());
Assert.Equal(expectedResult, input.Humanize());
}

[Theory]
Expand Down
6 changes: 6 additions & 0 deletions src/Humanizer.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=Localiser/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ordinalize/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ordinalized/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ordinalizer/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ordinalizers/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
2 changes: 1 addition & 1 deletion src/Humanizer/FluentDate/PrepositionsExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Humanizer
public static class PrepositionsExtensions
{
/// <summary>
/// Returns a new <see cref="DateTime"/> with the specifed hour and, optionally
/// Returns a new <see cref="DateTime"/> with the specified hour and, optionally
/// provided minutes, seconds, and milliseconds.
/// </summary>
public static DateTime At(this DateTime date, int hour, int min = 0, int second = 0, int millisecond = 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public string Convert(long number, bool addAnd)
}

/// <summary>
/// Converts the number to a specific string form using the locale's default gramatical gender and adds "and"
/// Converts the number to a specific string form using the locale's default grammatical gender and adds "and"
/// </summary>
public string Convert(long number, bool addAnd, WordForm wordForm)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public override string ConvertToOrdinal(int number)

if (number / 10 > 0 && number / 10 < 10)
{
return GetTwoDigigOrdinal(number);
return GetTwoDigitOrdinal(number);

}

Expand All @@ -91,7 +91,7 @@ private string GetOneDigitOrdinal(int number)
return output;
}

private string GetTwoDigigOrdinal(int number)
private string GetTwoDigitOrdinal(int number)
{
if (number == 11) return "ενδέκατος";
if (number == 12) return "δωδέκατος";
Expand All @@ -110,14 +110,13 @@ private string GetTwoDigigOrdinal(int number)

private string GetThreeDigitOrdinal(int number)
{

var hundrends = number / 100;

if (!ΟrdinalMap.TryGetValue(hundrends*100, out var hundrentsString)) return string.Empty;

if (number - hundrends*100> 10)
{
return hundrentsString + " " + GetTwoDigigOrdinal(number - hundrends*100);
return hundrentsString + " " + GetTwoDigitOrdinal(number - hundrends*100);
}

if(number - hundrends * 100 > 0)
Expand All @@ -142,7 +141,7 @@ private string GetFourDigitOrdinal(int number)

if (number - thousands * 1000 > 10)
{
return thousandsString + " " + GetTwoDigigOrdinal(number - thousands * 1000);
return thousandsString + " " + GetTwoDigitOrdinal(number - thousands * 1000);
}

if (number - thousands * 1000 > 0)
Expand Down
2 changes: 1 addition & 1 deletion src/Humanizer/Localisation/ResourceKeys.DateHumanize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static class DateHumanize
private const string FromNow = "FromNow";

/// <summary>
/// Generates Resource Keys accordning to convention.
/// Generates Resource Keys according to convention.
/// </summary>
/// <param name="timeUnit">Time unit</param>
/// <param name="timeUnitTense">Is time unit in future or past</param>
Expand Down
2 changes: 1 addition & 1 deletion src/Humanizer/StringHumanizeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static string Humanize(this string input)
return input;
}

// if input contains a dash or underscore which preceeds or follows a space (or both, e.g. free-standing)
// if input contains a dash or underscore which precedes or follows a space (or both, e.g. free-standing)
// remove the dash/underscore and run it through FromPascalCase
if (FreestandingSpacingCharRegex.IsMatch(input))
{
Expand Down