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

Expand contractions before slugging #117

Closed
passcod opened this issue Jan 28, 2018 · 3 comments
Closed

Expand contractions before slugging #117

passcod opened this issue Jan 28, 2018 · 3 comments

Comments

@passcod
Copy link

passcod commented Jan 28, 2018

Related to #105, but a different approach. Instead of omitting apostrophes and creating possibly-confusing words like wont or well, instead expand the contractions (opt-in?), thus creating do-not, will-not, we-will, etc.

From the readme, this example:

slug = getSlug('Don\'t drink and drive', {
	    titleCase: true
	});
console.log(slug); // Output: Don-t-Drink-And-Drive

would instead be:

slug = getSlug('Don\'t drink and drive', {
	    titleCase: true,
        expandContractions: true
	});
console.log(slug); // Output: Do-Not-Drink-And-Drive

The package contractions can be used for English.

I think there might be some use for this in French as well, but not as useful nor common. I'm not familiar enough with other languages.

@pid
Copy link
Owner

pid commented Mar 20, 2018

I think the better approach is to use the contraction module as needed and then pass it on to SpeakingURL. I don't want to inflate SpeakingURL; the goal is to use it in the browser -- size matters.

@passcod
Copy link
Author

passcod commented Mar 20, 2018

I guess? But also, contractions add <1K to the minified+compressed size, while if one really wanted to get the size down, they'd remove all the languages they didn't need and save about 3-4K. But I understand the argument.

@pid
Copy link
Owner

pid commented Sep 10, 2018

while if one really wanted to get the size down, they'd remove all the languages they didn't need and save about 3-4K. But I understand the argument.

You are right, but a module should do one thing right, and this feature would open multiple other tasks for other languages as well. So it's best, to use the contractions beforehand of speakingurl. Better make a new function and merge this two tasks.

So for now, I will close this request - sorry.

@pid pid closed this as completed Sep 10, 2018
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

No branches or pull requests

2 participants