Okay, here's one that I'm having a bit of difficulty figuring out. I want a quirk that puts as many exclamation marks at the end of a word as there are "I"s and "O"s in that word.
Here is! an example of! what I! am talking about!. Obviously!! this! is! more! difficult! than just putting! one! exclamation!! mark after words! with "I"s! and "O"s! in! general.
I hope that example is enough so that you know what I mean. Any ideas?
if there was a maximum number of exclamation marks that could also work.
I doubt that can be done in a single line of regex.
I know that paren matching cant be done in one line of regex...
anyway, I would suggest making it so every word ends with some placeholder
and then replace every i or o wiith an i or o and then a placeholder
and move those placeholders to after the other placeholder
and then turn them into explamation points.
I'm a little too tired to attempt to figure this out tonight, sorry. I'll try again tomorrow.
Last edited by XP105; 08-12-2012 at 12:12 PM.
I must learn python!
Does that pick up capital I's and O's as well?
I can make it so it does, but the quirk combo I was making was for lowercase anyway.
This would do it for capitals too.
Code:def exclaimer(text): count = 0 for x in text: if x == 'i' or x == 'o' or x == 'I' or x == 'O': count += 1 return text + ('!' * count)
is it possible to make some sort of spellchecker?
not like just going and doing simple replace or such, that would take FOREVER.
i mean would it be possible using python or something? to install a spell checker into pesterchum? :/
im reallyyyyyyy bad with code XD and i dont even do scripting like this (only themes ;w; ) so help me out guys oAo;
Last edited by ripplePounce; 08-13-2012 at 01:44 AM.
that is possible.
might be hard, and you wouldn't be able to check if for miss-corrections...
but yes it can definitely be done.
I might maybe work on it?
but probably not.
i don't see exactly how to...
well, ok, checking for 1 char off could be done...
oh, I suppose it could be done recursively?
that should be doable.
hey, in case anyone is less lazy than me sooner, heres the outline(its a slow algorithm, but it might not be too slow):
ok, so there would be three types of modifications that would be used.
one inserts a character
one removes a character
one adds a space NOTE:optional, if you add this, make sure to add sanity checks so words ghsdjk doesnt end up turning into a a a a a a a a a a ghsdjk
NOTE:this does not check for added spaces
NOTE:if you type something that is not at all a word, this algorithm will keep modifying it until it IS a word, or it reaches the specified maximum depth value. this might take a long time.
this spell checks a single "word", consisting solely of letters.
the argument it takes is the word, and an optional depth value
(the optional depth value defaults to something like 5 or whatever)
for each method of modifying:
for each place to modify:
modify it with the method at that location.
check to see if the result is a word
if it is, return it.
otherwise continue as follows.
check if the depth value is equal to 1.
if so return False
get the value of the function applied to the modified value, with the depth value decreased by one.
if the result of that is False, continue
if it is anything other than False, return the result
that should work, but there are many improvements that could be made.
this algorithm is a depth first search.
depth first is not a very good way to do this, as it will waste time looking at
before looking at anything more reasonable, like for example:
this contributes to this algorithm being SLOWWWWWW
you may want to find a better algorithm, possibly based on this one.
I believe this algorithm takes worst case time of
which is exponential time
its exponential with search depth
its polynomial with lengthofword
which I suppose isn't that bad.
I expect his algorithm is relatively likely to come up with a word that you did not mean.
I have neither implemented nor tested this algorithm.
I have no freaking clue how to do any of that.
Err..... you do know there are, like, a million python based spell checkers out there which, with a simple function calling a pre-built class, could be easily made into a quirk, right?
But I don't know what they are called.
And that was more fun to do than tea search what spell check libraries for python are good.
Hello ive been trying to make a quick nsucsesfully and wondered if you could help. im trying to replace all the letters of the alphabet with the greek letters , im not sure if the letters alt-codes are compatible for pesterchum or if i just havnt managed to find the right alt-codes yet, any help would be aprciated. i would also like a quicrk that starts a new line after every ' , ' ' . ' ' ? ' and/or ' ! ' again, eany help you can provide will be apreciated
i am silverShadow on trolian, Troll me whenever you want.
:O how do i incorporate one of those spell checkers into a quirk then??
one of my trolls uses very high grammar and such (and to be honest i am not the best speller lol ;w
As for the second quirk, that's impossible. Simply end the line after typing a comma, period, question mark, or explamation point.
I think you'd just place the python function in the quirks folder with a name for the quirk added to the end, hit the reload quirks button, then regexp replace ^(.*)$ with quirkname(\1).
As I've said though, I don't know python, so I'm not entirely sure.
It would require use of what I think is a bug, but it can be done in with python.
As you may or may not have noticed, pester chum messages have a maximum length.
If the message exceeds this length AFTER QUIRKS ARE APPLIED
It will split it into Separate messages.
All one has to do is make a python function that takes the part of the text that you want to be it's own message, and make it so the function pads it to the appropriate length.
However, one should insure that this is the last quirk applied,
Or take special care that quirks applied afterwards do not interfere undesirably.
Yes, well, I am not going to promote spamming the servers with useless characters just so someone doesn't have to press enter 3 times, and I'd rather no in here do so.
Sure, if one person's doing it, it's not much of a problem, but with enough people, all it results in is tons of short messages with large overhead, and nobody wants that.
You know, it sure would be nice if IRC accepted \n characters!
I'd like to request a quirk where words like 'like' become 'liek'? I basically wanna transpose any e at the end of a word back to just behind the nearest vowel in the word but I have no clue how to do so. Any help? 3: