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

Language output is incorrect when the language name has one or more spaces #2

Open
DecimalTurn opened this issue Sep 28, 2024 · 1 comment · May be fixed by #3
Open

Language output is incorrect when the language name has one or more spaces #2

DecimalTurn opened this issue Sep 28, 2024 · 1 comment · May be fixed by #3

Comments

@DecimalTurn
Copy link

Example language: "Visual Basic .NET"
Example repo: https://github.com/narekye/VB.NET

Expected output: "Visual Basic .NET"
Actual output: ".NET"

@DecimalTurn
Copy link
Author

One way to fix this would be to replace:

lpct.append((L[-1], L[0][:-1]))

with:

        lang = ""
        # Loop over the elements of L starting from the end and append the elements until we reach the number of lines
        for i in range(len(L) - 1, -1, -1):
            if L[i].isdigit():
                break
            if lang:
                lang = L[i] + " " + lang
            else:
                lang = L[i]

        lpct.append((lang, L[0][:-1]))

@DecimalTurn DecimalTurn changed the title Language output is incorrect when the language name as one or more spaces Language output is incorrect when the language name has one or more spaces Sep 28, 2024
@DecimalTurn DecimalTurn linked a pull request Dec 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant