Skip to main content
Question

given unlimited numbers in the raw source the numbers converted in to the another language it possible or not


tomjerry.vl
Forum|alt.badge.img

review above attached pic the unlimited numbers converted into the Portuguese language how to possible

11 replies

danilo_fme
Evangelist
Forum|alt.badge.img+45
  • Evangelist
  • December 23, 2019

Hi @tomjerry.vl

This is possible if you use some API. Fox example: you can read your File and use the transformer HTTPCaller to connect a URL - API.

The results will be in Json or XML format - then you can use transformers for these formats to extract the nformations.

Do you know any API free to use?

 

Thanks,

Danilo


Forum|alt.badge.img
  • December 23, 2019

This would have been so much worse if you needed French. :-D

Here's my solution. Put your source data in place of my first AttributeCreator and fill up the StringPairReplacers:


Forum|alt.badge.img
  • December 23, 2019
danullen wrote:

This would have been so much worse if you needed French. :-D

Here's my solution. Put your source data in place of my first AttributeCreator and fill up the StringPairReplacers:

Oh, and you need to remove the regex "e Zero$" from the result as well, for numbers ending with zero that aren't actually zero.


david_r
Celebrity
  • December 23, 2019
danullen wrote:

This would have been so much worse if you needed French. :-D

Here's my solution. Put your source data in place of my first AttributeCreator and fill up the StringPairReplacers:

Would it work in German as well? They say six-and-eighty rather than eigthy-six :-)


Forum|alt.badge.img
  • December 23, 2019
david_r wrote:

Would it work in German as well? They say six-and-eighty rather than eigthy-six :-)

No, I think we are lucky that the question was about Portuguese. :-)


redgeographics
Celebrity
Forum|alt.badge.img+50
danullen wrote:

No, I think we are lucky that the question was about Portuguese. :-)

Good thing it's not French... (4 * 20) + 10 + 9


Forum|alt.badge.img
  • December 23, 2019
redgeographics wrote:

Good thing it's not French... (4 * 20) + 10 + 9

Yes, French would require Python I guess. :-D

 

And btw, to @tomjerry.vl, I forgot that you would have to add a StringReplacer at the end to convert numbers 11-19, from "Dez e Um" to "Onze" and so on.

tomjerry.vl
Forum|alt.badge.img
  • Author
  • December 27, 2019
danullen wrote:

This would have been so much worse if you needed French. :-D

Here's my solution. Put your source data in place of my first AttributeCreator and fill up the StringPairReplacers:

I execute this workbench but not getting the result this workbench consider only last characters in street name like

like

in this name your work considered only last characters and numbers remaining not consider others

please ex-plane how to resolve this situation

 


Forum|alt.badge.img
  • December 27, 2019
tomjerry.vl wrote:

I execute this workbench but not getting the result this workbench consider only last characters in street name like

like

in this name your work considered only last characters and numbers remaining not consider others

please ex-plane how to resolve this situation

 

Put a new AttributeCreator before your AttributeCreator_2 where you create the new attribute "Digits" with the value:

 

@ReplaceRegEx(@Value(STRT_NAME),[^\\d+],"")

Then modify your AttributeCreator_2 to use the new attribute like this:

 

@Substring(@Value(Digits),-1,1)

 

and so on.

This will give you the numbers and translate them into text. Finally you need to use a StringReplacer for your street name where you search for @Value(Digits) and replace with _result.


tomjerry.vl
Forum|alt.badge.img
  • Author
  • December 31, 2019
danullen wrote:

Put a new AttributeCreator before your AttributeCreator_2 where you create the new attribute "Digits" with the value:

 

@ReplaceRegEx(@Value(STRT_NAME),[^\\d+],"")

Then modify your AttributeCreator_2 to use the new attribute like this:

 

@Substring(@Value(Digits),-1,1)

 

and so on.

This will give you the numbers and translate them into text. Finally you need to use a StringReplacer for your street name where you search for @Value(Digits) and replace with _result.

Thanks @danullen

It's working and one more extension i.e if i get value like this "path 44 highway 99"

it return 4499 but it is wrong.

i need to calculate 44 in digit and 99 in some other field like digit_1


Forum|alt.badge.img
  • December 31, 2019
tomjerry.vl wrote:

Thanks @danullen

It's working and one more extension i.e if i get value like this "path 44 highway 99"

it return 4499 but it is wrong.

i need to calculate 44 in digit and 99 in some other field like digit_1

You can just continue with the regular expressions. You can test for these special cases with this regex:

\\d+[^\\d]+\\d+

That will pass the test if there are a minimum two groups of digits with other characters between them.

Then you can split the address using other regexes to catch 44 in the attribute Digit and 99 in Digit_1. If you haven't used it yet, check out regex101.com or similar to find the correct regex for your needs. Good luck! :)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings