Thank you David. I have not tried the Python-Code, but the StringPairReplacer works fine. However, I need to create a new transformer for every attribute. Is there a way to do it in one just transformer? Probably the PythonCaller, but my knowledge of that is still very limited, so I would rather avoid using it ,-))
Â
Â
Kind regards
Â
Thomas
Hi,
Â
Â
yes, the PythonCaller code I posted there supports multiple attributes. Just modify the line
Â
Â
attribute_list = ("name", "type", "state")
Â
Â
so that it lists the attributes you want to modify. Note that the attribute names are case sensitive.
Â
Â
David
Hi,
Â
Â
You can use a attributecreator and set the conidtionalcreator.
Â
Make for each character one condition, in your example 7 conitions.
Â
Use TCL like following.
Â
Â
conditions:
Â
Â
@Evaluate(vregexp -all {Ä} "@Value(string)"])=1
Â
and its output value:
Â
@Evaluate(@Evaluate((regsub -all {Ä} "@Value(string)" A string])>0?"$string":"@Value(string)")
Â
Â
@Evaluate(
 and its output value:Â
@Evaluate(@Evaluate(aregsub -all {ß} "@Value(string)" ss string])>0?"$string":"@Value(string)")Â
Â
etc.etc.Â
Â
Now u have one attributecreator to do the mapping.Â
Â
Â
Hi,
Â
Â
Just an additional info. If you are interested in Tcl script, I think "string map" procedure is worth to try. An AttributeCreator with this value setting works like the StringPairReplacer.
Â
 @Evaluate(.string map {Ä A ä a Ö O ö o Ü U ü u ß ss} {@Value(source)}])
 Takashi
Thank you guys for your help!
Â
Â
The Tcl script works very well. Are there some explanations on safe.com where I can learn more about this "string map" thing, or this this pure Tcl?
Â
Â
If I try it with the Python script, I get the following error:
Â
Â
PythonFactory failed to load python symbol `FeatureProcessor'
Â
Factory proxy not initialized
Â
PythonFactory failed to process feature
Â
PythonFactory failed to process feature
Â
A fatal error has occurred. Check the logfile above for details
Â
Â
 import fmeobjects import unicodedata as ud def rmdiacritics(char):     '''     Return the base character of char, by "removing" any     diacritics like accents or curls and strokes and the like.     '''     desc = ud.name(unicode(char))     cutoff = desc.find(' WITH ')     if cutoff != -1:         desc = desc :cutoff]     return ud.lookup(desc)      def removeAccents(feature):     attribute_list = ("Trasse")     for attrib in feature.getAllAttributeNames():         if attrib in attribute_list:             value = feature.getAttribute(attrib)             if value:                 value = unicode(value)                 new_value = ''.join(mrmdiacritics(char) for char in value])                 feature.setAttribute(attrib, new_value)
Â
Â
Hi,
Â
Â
for the PythonCaller, you have to specify the name of the function that process your features. In the code I posted this is "removeAccents", so you need to setup the PythonCaller like this:
Â
Â
Â
Â
David
With this the Python function works. But as you wrote, the function is for accents and curls and so on. I guess I have to adapt it to the german characters, if I had more Python knowledge ,-)
Â
Â
Here, it makes Böschung to Boschung. But the right way would be Boeschung. (don't know if the forum displays the special signs).
Â
Â
But no need there, since the solution with the AttributeCreator works very well.
Â
Â
Many thanks again to all.
Â
Â
Kind regards
Â
Thomas
Â
Â
Yeah, the approaches are rather different, in the end you pick what works for you :-)
Â
Â
The solution provided by Takashi was pretty neat given your constraints.
Â
Â
David
There are two character types for representing numbers in Japanese. One is Arabic number {1, 2, 3, 4, ...} same as ascii, another type is Kanji number {?, ?, ?, ?, ...} same as Chinese Hanzi.
Â
Sometimes I need to convert between them, Tcl "string map" is convenient in such a case.
Â
Â
Strictly, there is one more type - 2 byte Arabic number {?, ?, ?, ?, ...}.
Â
... idle talk.