FEAT: add superscript converter - #818
Conversation
… sample based on percentage
|
While working on this, I came up with a few additional options/modes for conversion:
What do you think about these? Would any of them be valuable to add? As for subscripts, I believe we could implement this by adding an optional boolean parameter to the SuperscriptConverter class. What do you think? |
SuperscriptConverter|
You can see I tagged you and this PR in #822 because I think a lot of these patterns can be generalized so that we don't have to reinvent the wheel over and over again for various converters. That said, if you want to leave that for a future issue/PR that's totally fine! |
I totally agree! It 100% makes sense to generalize the common patterns first, so I think I’ll wait with this PR until that’s done |
|
I have an idea: maybe we could add a base class for all the simple word-level converters, like So the usage would look like this: keyword_converter = SuperscriptConverter(
mode="keywords",
keywords=['test', 'conversion']
)And in place of class ROT13Converter(WordLevelPromptConverter):
async def convert_word_async(self, word: str) -> str:
return codecs.encode(word, "rot13")The concept's commit: /commit/be8a5d972fb4e7568e11954d9c531d063766d07d |
I love it! What do others think? @rlundeen2 Nina Chikanov (@nina-msft) Eugenia Kim (@eugeniavkim) jbolor21 Justin Song (@jsong468) Bashir Partovi (@bashirpartovi) |
|
Paulina Kalicka (@paulinek13) I suppose we can continue this one now that #847 is in! It might be much simpler now 🙂 |
|
Sure thing! I'm on it 😃 |
|
The SuperscriptConverter and its tests are now updated, I just have a few questions:
|
Description
This PR aims to resolve #528 by adding a new converter:
SuperscriptConverter.Tests and Documentation
I've added unit tests for the converter