Gary, thank you for your response.

I initiated the pull request (#528) and already received some very
constructive feedback from user mbenson.
I am modifying the code to contain fewer methods that may be externally
modified by a user, if something as simple as .toLowerCase() is required.

I also noticed some recent discussion of this which you commented on in
pull 450  Cases API + 4 implementations (Pascal, Camel, Kebab, Snake) #450

When I am done with the edits and new tests and pushed them to my fork, I
may join this conversation #450.

My Jira account has been approved (after an initial disapproval.) I haven't
looked at it yet, I will look for similar topics there.

I also uncovered an issue with my code when I devised some tests I
specifically designed to break it if possible, and I need to fix this.

        assertThat(CaseUtils.toTitleCase(" ' \u2019 Titl'e Case \u2019 '
")).isEqualTo("Title_Case");  // todo fix this failure.

org.opentest4j.AssertionFailedError:
expected: "Title_Case"
 but was: "Title_Case_’_'"
Expected :"Title_Case"
Actual   :"Title_Case_’_'"

This is because of the way I handle apostrophes so "That's good!" will
return "Thats_Good"

Again, thank you for your response.

Stephan Peters


On Tue, Apr 9, 2024 at 5:56 PM Stephan Peters <stephan.pet...@csuglobal.edu>
wrote:

> OK, I will initiate a PR.
> Some of the added methods will be more useful than others.
> The PR will come from speters33w.
>
> Thank you,
> Stephan Peters
>
> On Tue, Apr 9, 2024 at 5:31 PM Gary Gregory <garydgreg...@gmail.com>
> wrote:
>
>> Hello Stephan,
>>
>> The best way to see what you are proposing is a PR, it's a bit painful to
>> see differences otherwise, at least for me.
>>
>> That said anything new should solve a real world use case, not merely
>> something that might be useful (or not) 😉
>>
>> I think seeing tests in a PR will help clarify what it is you are
>> proposing
>> that the current code doesn't do.
>>
>> See also also https://github.com/apache/commons-text/pull/450
>>
>> TY,
>> Gary
>>
>> On Tue, Apr 9, 2024, 4:37 PM Stephan Peters
>> <stephan.pet...@csuglobal.edu.invalid> wrote:
>>
>> > I added several methods to the org.apache.commons.CaseUtils class I
>> think
>> > would be very useful, for example to use for normalized naming
>> conventions
>> > for file paths, file names, URLs, etc.
>> >
>> > I'm planning on initiating a pull request.
>> >
>> > I would like to discuss it here.
>> >
>> > I've posted it in a fork here:
>> >
>> >
>> https://github.com/speters33w/commons-text/blob/master/src/main/java/org/apache/commons/text/CaseUtils.java
>> >
>> > and written new tests for all the methods that pass here:
>> >
>> >
>> https://github.com/speters33w/commons-text/blob/master/src/test/java/org/apache/commons/text/CaseUtilsTest.java
>> >
>> > There is an example of the method return values at the top of the
>> revised
>> > CaseUtils.java.
>> >
>> > The methods have a little different behavior than the existing
>> > toCamelCase(String, boolean, char[]) (which I left intact) in that they
>> > normalize the input first before processing, so toCamelSnakeCase("The
>> > café’s piñata gave me déjà vu.") will return
>> > "the_Cafes_Pinata_Gave_Me_Deja_Vu"
>> >
>> > The main driver engine is in the toTitleCase() method and the rest of
>> the
>> > methods piggyback on that engine and perform minor changes to the return
>> > value.
>> >
>> > If anyone feels like taking a look, I'd appreciate any feedback.
>> >
>> > Thank you.
>> >
>> > Stephan Peters
>> >
>>
>

Reply via email to