Created
December 30, 2009 13:34
-
-
Save Riduidel/266047 to your computer and use it in GitHub Desktop.
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
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