这是indexloc提供的服务,不要输入任何密码
Skip to content

Add prefix and suffix truncation to lookup strategy #28

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

Merged
merged 5 commits into from
Oct 8, 2020
Merged

Add prefix and suffix truncation to lookup strategy #28

merged 5 commits into from
Oct 8, 2020

Conversation

fridgepoet
Copy link

@fridgepoet fridgepoet commented Oct 4, 2020

Description

Relates to #21
@FungusHumungus

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • Running existing tests
  • Created new tests

Checklist:

  • My code has been linted (make lint)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have rebased my branch to include the latest changes from master

@fridgepoet fridgepoet changed the title Add prefix truncation to lookup strategy Add prefix and suffix truncation to lookup strategy Oct 4, 2020
"arian": "arn",
"ism": "sm"}}

assert.Equal(t, "antdsestblshmntarnsm", m.Match("antidisestablishmentarianism"))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would happen is the replacements dis and arian weren't available? How long would the abbreviation be? Especially since arian isn't one of the available suffixes above?

My worry here is that this test is a little too specific to this word.

Copy link
Owner

@dnnrly dnnrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you also be able to add a little detail about abbreviation guessing to the README and perhaps the usage text? A little documentation goes a really long way!

Fundamentally, this is a really good PR. It'll only take a little massaging before it's ready.

Copy link
Author

@fridgepoet fridgepoet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've added a test to try to illustrate that abbreviating stops once a prefix/suffix is not found. Let us know if you'd like anything clearer on that. Same for the documentation.

@dnnrly dnnrly merged commit 6c4c805 into dnnrly:master Oct 8, 2020
@fridgepoet fridgepoet deleted the trim branch October 8, 2020 14:48
@dnnrly
Copy link
Owner

dnnrly commented Oct 8, 2020

@shirleyleu and @FungusHumungus, do you do Twitter? I think this contribution deserves a shout out. 😁

@fridgepoet
Copy link
Author

:) https://twitter.com/shirley_leu it's mostly for occasional post-it doodles.

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 this pull request may close these issues.

2 participants