-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert Free Form Text to Enum #26
Comments
Given the tests that we're doing this month through different fronts, this feature will be certainly used in several ways to simplify the task of mapping an input to output, according to some kind of instructions. A possible approach here could be creating a new functionality To exemplify this idea, suppose the use-case where we need to do these conversions: Input -> Output We will call our new functionality
PS 1.: I proposed to use the input as the dictionary value because in this way we can have multiple inputs pointing to the same output (key), but the otherwise will also work. PS 2.: The name In this case, we will be returning always the first match as output. This is the first idea that comes to my mind in terms of doing this function in a concise way, keeping it simple/readable. Let me know what you think about it and if there is something that I miss here. 😃 |
Hi @renancunha
This would be for the list value in the key-value pair right? So in your example of The
would be:
Shublang, by its DSL nature, is stateless. So we could not refer to anything that was pre-defined before and refer to it in the future. The only reference it uses are the inputs and outputs via pipes, such as:
I'm wondering if this breaks its statelesness. However, it might just be the necessary evil we need to handle those large mappings that would support the entire suite of the What do you guys think? |
Hi @BurnzZ
In that case, About the question of long mapping values, you're right. I had the same concern here. Following this approach, sometimes we will have huge mappings. The idea is that you define the entire mapping set up once, and call the |
The availability field of the unified schema can have the following values
As an example, the text "Limited quantity available" in the image below maps to
LimitedAvailability
.Currently such a transformation would be very unwieldy using shublang expressions and would have to be managed outside it's context.
The text was updated successfully, but these errors were encountered: