Question

How to find an attribute from a list in db records

  • 5 September 2018
  • 1 reply
  • 1 view

Badge

Hello,

I have a list of countries in csv format e.g.: ALBANIA, AUSTRALIA, COLOMBIA, CHILE, NORWAY etc. and I have some records I'm reading from a database. I would like to find out if the description part of these records contains one of these countries from the csv. A description could be : CHINESE NOTICE 14/261; JAPANESE NOTICE 28; GERMAN NOTICE 23; COLOMBIAN NOTICE 172; SWEDISH NOTICE 593; GREEK CHART 311; AUSTRALIAN NOTICE 993. So the country name is not necessarily complete (Chinese, Swedish) or the description is longer than the country name (Japanese, Australian). Any tips what transformer to use? Thanks!


1 reply

Userlevel 4
Badge +13

Hi @kat Instead of trying to calculate the adjective from the name (or vice versa) I'd recommend importing a list of country names and adjectives. I found a couple at https://en.wikipedia.org/wiki/List_of_adjectival_and_demonymic_forms_for_countries_and_nations and https://siteresources.worldbank.org/TRANSLATIONSERVICESEXT/Resources/CountryNamesandAdjectives.doc Then use an AttributeValueMapper, FeatureMerger, or FeatureJoiner to relate your csv list to your database.

Reply