-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Proposal: Adding additional languages support #27
Draft
danielcrenna
wants to merge
35
commits into
bleroy:main
Choose a base branch
from
danielcrenna:multi
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.
Draft
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
b13a222
lazy stash
danielcrenna a3e65eb
Merge branch 'main' into multi
danielcrenna 2632d56
fixes and tests for Among
danielcrenna 22d8cd6
add french stop word filter and tests
danielcrenna 9938467
add FrenchTrimmer and tests
danielcrenna f49dba2
add French search tests
danielcrenna 008509c
Merge branch 'main' into multi
danielcrenna f688881
add all language trimmers
danielcrenna 6f0fe59
add arabic stop word filter; use string parse approach per lunr-langu…
danielcrenna 29faf11
add all stop word filters (thai does not use one)
danielcrenna e5eff94
port ItalianStemmer and tests
danielcrenna e382b1e
add non-lmdb italian search tests
danielcrenna 2b52c5e
nit: nullability warnings
danielcrenna 2c05a22
re-org into i18n folders
danielcrenna 1e18c81
add German stemmer and tests (stemmed word test fails!)
danielcrenna f0428d0
add test for failing stemmed word
danielcrenna 1d8e0ff
remove dumb attrib again
danielcrenna d22a2b6
remove unnecessary usings
danielcrenna 7bb449b
remove unnecessary usings
danielcrenna 6117609
make SnowballProgram a little more idiomatic
danielcrenna 31210b7
fix Among equal comparison
danielcrenna 069ed0d
rename main stem method to StemImpl
danielcrenna dd215b6
use idiomatic ArgumentNullException
danielcrenna b0f360c
add .editorconfig to help linting per project preferences
danielcrenna e2dcd7c
lint branch code
danielcrenna 1ab7162
convert to unicode
danielcrenna d92b9a4
fix Among hashcode, cleanup tests
danielcrenna c69bba5
make Among fields read-only properties; add attribution for lunr-lang…
danielcrenna 8162a92
finish unicode conversion for FrenchStemmer
danielcrenna 07551ea
remove param tags for non-existing params
danielcrenna 7361656
unescape remaining unicode chars in stemmers
danielcrenna 87909d2
remove static ctors in stemmers + linting
danielcrenna 896812d
string.Empty => ""
danielcrenna f30515f
remote static ctors in trimmers
danielcrenna c086b31
combine trimmers into single regex replacement
danielcrenna 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 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# See: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/formatting-rules | ||
|
||
[*.cs] | ||
indent_style=tab | ||
indent_size=tab | ||
tab_width=4 | ||
|
||
[*.{appxmanifest,axml,build,config,csproj,dbml,discomap,dtd,json,jsproj,lsproj,njsproj,nuspec,proj,props,resjson,resw,resx,StyleCop,targets,tasks,vbproj,xml,xsd}] | ||
indent_style=space | ||
indent_size=2 | ||
tab_width=2 | ||
|
||
[*.cs] | ||
csharp_prefer_braces = true | ||
csharp_new_line_before_open_brace = methods, properties, control_blocks, types |
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using System; | ||
using System.Linq; | ||
|
||
namespace Lunr.Globalization | ||
{ | ||
public readonly struct Among : IEquatable<Among> | ||
bleroy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
public int Size { get; } | ||
public char[] StringArray { get; } | ||
public int Result { get; } | ||
public Func<bool>? Method { get; } | ||
public int Substring { get; } | ||
|
||
public Among(string s, int substring, int result, Func<bool> method = default!) | ||
{ | ||
if (s == null) | ||
{ | ||
throw new ArgumentNullException(nameof(s)); | ||
} | ||
|
||
Size = s.Length; | ||
StringArray = s.ToCharArray(); | ||
Substring = substring; | ||
Result = result; | ||
Method = method; | ||
} | ||
|
||
public bool Equals(Among other) | ||
{ | ||
return Size == other.Size && | ||
StringArray.SequenceEqual(other.StringArray) && | ||
Result == other.Result && | ||
Method == other.Method && | ||
Substring == other.Substring; | ||
} | ||
|
||
public override bool Equals(object? obj) | ||
{ | ||
return obj is Among other && Equals(other); | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return (Size, StringArray, Result, Method, Substring).GetHashCode(); | ||
} | ||
|
||
public static bool operator ==(Among left, Among right) | ||
{ | ||
return left.Equals(right); | ||
} | ||
|
||
public static bool operator !=(Among left, Among right) | ||
{ | ||
return !left.Equals(right); | ||
} | ||
} | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaaaargh! Nooooooo! Spaces, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.youtube.com/watch?v=SsoOG6ZeyUI&t=80s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed one of the better parts of SV...