algorithms – Name of design pattern for "unidirectional data conversion"

Various coding experiments have made me stumble over what I would consider to be a design model for "unidirectional data conversion", that is, to transform some data in a meaningful way while avoiding transform in the opposite way (or in another apparently inappropriate way). This schema was probably identified and named a long time ago and my question is: what do you call it?

Here are some illustrations.

First example, case-insensitive comparison. Leave a string variable X be checked for equal equality without breaking with a reference value held by the variable reference value. You will use a test such as lower (x) == lower (refValue), that is, converting both X and reference value in lower case, then check for equality. At no time are you trying to restore lower (x) return to X with its original case.

Another illustration now, inspired by Symfony's translation mechanism. In Symfony, you can declare a set of translated values ​​as variable depth structures. An example presented in JSON format:

{
"Hey": {
"ho": "let's go,"
"man": {
"Nice shot"
}
"summer.talk": "to meet you"
}
"hey.there": "luna"
}

The translation system then makes it possible to search for a translation using dot-syntax keys: $ translator-> translate (hey.been.trying & # 39;) will come back 'Meet you & # 39;. I did not go through Symfony, but I guess at an early stage, the definition structure is flattened into a simple lookup table:

key | value
---------------- | -------------
hey.ho | Let's go
hey.man.nice | stroke
hey.been.trying | Meet you
hey.there | luna

then $ Translator Just look for a translation in this table. It sounds like the right approach for me. An inverse strategy would be to divide the argument into a table (turn & # 39; hey.been.trying & # 39; in ['hey', 'been', 'trying']) and use the table to search for a translation in the original structure. This would be inefficient and, in the example provided, would fail to & # 39; hey.been.trying & # 39; and & # 39; hey & # 39;. Thus, one of the methods of data conversion (flattening of the structure) seems much more appropriate than the opposite method (key splitting).

What I see in both illustrations is that the process causes a loss of information (original case / depth of the original structure). Maybe this is an allusion to the name of the motif?