View Single Post
Old 09-25-2015, 11:47 AM   #68
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 203
Karma: 62362
Join Date: Jul 2015
Device: Sony
@gipsy: If I have understood your code correctly, the search expression will find a word that is preceded by character(s) in the search pattern and send this word to function FixP(). Let's call this word test word.
FixP() puts 'Π'in front of test word to form a new word (call it a check word) and then looks in the dictionary to check whether or not the check word is in the dictionary.
If the check word is in the dictionary then the function returns the check word, otherwise it returns the test word.

Eg If the word being examined is IITest, your code will send IITest to Fix(). If ΠTest is in the dictionary then your code will return ΠTest otherwise it will return IITest.

If this is what you wanted the code to do then it is correct.

@Doitsu: Thanks for the link relating to the new regex library for Python. I like the idea of importing regex expressions from a saved search group into the plugin; I originally developed this plugin because I had several different groups of saved searches and I wanted to run them all together. I will be looking into all your suggestions, time permitting.
CalibUser is offline   Reply With Quote