• Re: Embedded numbers sorting function (begging post)

    From Anton Shepelev@21:1/5 to All on Sat Jun 15 01:09:18 2024
    Kaz Kylheku:

    Kaz Kylheku:

    Yes; I just whipped up this piece of simplicity in 15
    minutes:

    Additional hack for considering sequences of spaces and
    tabs to be one space:

    A friend of mine is interested in feeding this task to an
    LLM. Can you please provide are more precise description of
    what you solution does, than the very informat one from
    Malcolm?

    --
    () ascii ribbon campaign -- against html e-mail
    /\ www.asciiribbon.org -- against proprietary attachments

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Shepelev@21:1/5 to All on Sat Jun 15 02:07:18 2024
    Malcolm McLean:
    Anton Shepelev:
    Kaz Kylheku:
    Kaz Kylheku:

    Yes; I just whipped up this piece of simplicity in
    15 minutes:

    Additional hack for considering sequences of spaces
    and tabs to be one space:

    A friend of mine is interested in feeding this task to
    an LLM. Can you please provide are more precise
    description of what you solution does, than the very
    informat one from Malcolm?

    If you go into my hobby project and check the "bbx_ls"
    program, or the equivalent now embedded with the shell,
    you will find this function.

    I was asking Kaz for a specification or at least a
    relatively precise description of the task, rather than a
    ready solution. But I thank you for the reference anyway,
    and will use it as another human solution to compare against
    that by the LLM. Yes, I have found Martin Pool's
    implementation that you use:

    <https://github.com/sourcefrog/natsort>

    and now I see had come across it before. It does not have
    an exact specification, but I get an idea.

    It was not written by me, though I'm surely capable of
    writing it if demanded. But it's not entirely
    straightforwards.

    I thought of representing each string as sequence of
    alternating text and numberic chucnks, and compareing them
    pairwise, e.g.

    Item 153 of batch 17a

    will be parsed into five chunks:

    Item 153 of batch 17a
    111112223333333333445

    and comparisons made chunk-wise, according to their types.
    Chunks of different types shall be compared as text.

    --
    () ascii ribbon campaign -- against html e-mail
    /\ www.asciiribbon.org -- against proprietary attachments

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)