Skip to content

Instantly share code, notes, and snippets.

@Riduidel
Created December 30, 2009 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Riduidel/266039 to your computer and use it in GitHub Desktop.
Save Riduidel/266039 to your computer and use it in GitHub Desktop.
class Config
# ... il y a du code avant
# Find the appropriate signature for the given file
def find(_text)
processed = Signature.splitSentence(_text)
values = {}
@signatures.each do |sig|
values\[sig.compute(processed)\]=sig
end
sortedValues = values.sort {|a,b| -1*(a\[0\]< =>b\[0\])}
return sortedValues\[0\]\[1\].signatureText
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment