Skip to content

Instantly share code, notes, and snippets.

@Riduidel
Created December 30, 2009 13:34
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/266047 to your computer and use it in GitHub Desktop.
Save Riduidel/266047 to your computer and use it in GitHub Desktop.
def createSignatureMetaData
# Metadata is the first line of the signature, from -- to \
lineReturnPos = @signatureText.index($/)
# hard-coded (yuck !) management of the trailing "-- "
allMeta = @signatureText\[3, lineReturnPos-3\]
# text signature begins at line 2
@signatureText = @signatureText\[lineReturnPos+1, @signatureText.size-lineReturnPos-1\]
# If there are metadata in the first line, it has to be processed
if allMeta
# If there is a parenthesis, it's the signature name
if parenthesis = allMeta.index("(")
@name = allMeta\[parenthesis+1, (closing = allMeta.index(")"))-parenthesis-1\]
allMeta = allMeta\[closing+1, allMeta.size\].strip
end
# now, generating external keywords
if allMeta
populateKeywords(Signature.splitSentence(allMeta), @config.weight, @config.ignoredWords)
end
end
# in any case, metadata associated with signature words has to be generated
populateKeywords(Signature.splitSentence(@signatureText), @config.autoWeight, @config.ignoredWords)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment