-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Acronym] Approach docs cleanup #4258
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
Open
Yrahcaz7
wants to merge
5
commits into
exercism:main
Choose a base branch
from
Yrahcaz7:acronym-approach-cleanup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9af50e9
formatting fixes & replace "scrub" with "clean"
Yrahcaz7 83b4f0e
update performance snippet to match article
Yrahcaz7 b50b857
fix the intro present in most approaches
Yrahcaz7 afbd8ad
improve clarity and fix rendering issues
Yrahcaz7 935f65d
Separate `re.finditer()` into a variation
Yrahcaz7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
exercises/practice/acronym/.approaches/double-generator-expression/snippet.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| VALID_CHARS = {' ', '-'} | set(ascii_letters) | ||
| VALID_CHARS = {" ", "-"} | set(ascii_letters) | ||
|
|
||
| def abbreviate(to_abbreviate): | ||
| to_abbreviate = ''.join(' ' if char == '-' else char | ||
| to_abbreviate = "".join(" " if char == "-" else char | ||
| for char in to_abbreviate | ||
| if char in VALID_CHARS) | ||
|
|
||
| return ''.join(word[0] for word in to_abbreviate.split()).upper() | ||
| return "".join(word[0] for word in to_abbreviate.split()).upper() |
35 changes: 18 additions & 17 deletions
35
exercises/practice/acronym/.approaches/functools-reduce/content.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
exercises/practice/acronym/.approaches/functools-reduce/snippet.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| from functools import reduce | ||
|
|
||
| def abbreviate(to_abbreviate): | ||
| phrase = to_abbreviate.replace("_", " ").replace("-", " ").upper().split() | ||
| phrase = to_abbreviate.replace("-", " ").replace("_", " ").upper().split() | ||
|
|
||
| return reduce(lambda start, word: start + word[0], phrase, "") | ||
37 changes: 19 additions & 18 deletions
37
exercises/practice/acronym/.approaches/generator-expression/content.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
exercises/practice/acronym/.approaches/generator-expression/snippet.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| def abbreviate(to_abbreviate): | ||
| phrase = to_abbreviate.replace('-', ' ').replace('_', ' ').upper().split() | ||
| phrase = to_abbreviate.replace("-", " ").replace("_", " ").upper().split() | ||
|
|
||
| # note the lack of square brackets around the comprehension. | ||
| return ''.join(word[0] for word in phrase) | ||
| # Note the lack of square brackets around the comprehension. | ||
| return "".join(word[0] for word in phrase) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.