This repository has been archived by the owner on Feb 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scoring partly done. Its now in a state that it can be used. =D
- Loading branch information
Nathan Button
committed
Oct 6, 2015
1 parent
bcad144
commit e479b1b
Showing
9 changed files
with
561 additions
and
186 deletions.
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 @@ | ||
zxcvbn |
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
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,38 @@ | ||
package match | ||
|
||
type Matches []Match | ||
func (s Matches)Len() int { | ||
return len(s) | ||
} | ||
func (s Matches)Swap(i, j int) { | ||
s[i], s[j] = s[j], s[i] | ||
} | ||
func (s Matches) Less(i, j int) bool { | ||
if s[i].I < s[j].I { | ||
return true | ||
} else if s[i].I == s[j].I { | ||
return s[i].J < s[j].J | ||
} else { | ||
return false | ||
} | ||
} | ||
type Match struct { | ||
Pattern string | ||
I, J int | ||
Token string | ||
MatchedWord string | ||
Rank float64 | ||
DictionaryName string | ||
Turns int | ||
ShiftedCount int | ||
Entropy float64 | ||
} | ||
|
||
type DateMatch struct { | ||
Pattern string | ||
I, J int | ||
Token string | ||
Separator string | ||
Day, Month, Year int64 | ||
|
||
} |
Oops, something went wrong.