Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaria Volvenkova <d.volvenkova@corp.mail.ru>2017-03-29 17:08:01 +0300
committerDaria Volvenkova <d.volvenkova@corp.mail.ru>2017-03-30 15:08:44 +0300
commit0f1fb3c9f81e3d0844613f145b995f9497f9437d (patch)
tree9c61cea2cf3cb73dabe5c8530c31b0a7bd3497d9
parent965d71afc32981da4205b7b3189771acb0764e3a (diff)
Review fixes.
-rw-r--r--3party/icu/CMakeLists.txt778
-rw-r--r--coding/CMakeLists.txt4
-rw-r--r--coding/multilang_utf8_string.cpp96
-rw-r--r--coding/transliteration.cpp17
-rw-r--r--coding/transliteration.hpp4
-rw-r--r--generator/srtm_coverage_checker/srtm_coverage_checker.pro4
-rw-r--r--indexer/feature_utils.cpp33
-rw-r--r--indexer/feature_utils.hpp8
-rw-r--r--map/framework.cpp36
-rw-r--r--map/framework.hpp2
-rw-r--r--map/map_tests/CMakeLists.txt1
-rw-r--r--map/map_tests/transliteration_test.cpp57
-rw-r--r--map/style_tests/CMakeLists.txt2
-rw-r--r--xcode/map/map.xcodeproj/project.pbxproj4
14 files changed, 554 insertions, 492 deletions
diff --git a/3party/icu/CMakeLists.txt b/3party/icu/CMakeLists.txt
index 85432e5fd6..df28d652ca 100644
--- a/3party/icu/CMakeLists.txt
+++ b/3party/icu/CMakeLists.txt
@@ -8,66 +8,17 @@ add_definitions(
-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS
-DU_DISABLE_RENAMING)
-add_compile_options(
- "-Wall"
-)
-
set(CMAKE_PREFIX_PATH ./)
include_directories(common i18n common/unicode ./)
set(
SRC
- common/cmemory.c
- common/cstring.c
- common/cwchar.c
- common/icudataver.c
- common/locmap.c
- common/propsvec.c
- common/uarrsort.c
- common/ubidi.c
- common/ubidi_props.c
- common/ubidiln.c
- common/ubidiwrt.c
- common/ucat.c
- common/uchar.c
- common/ucmndata.c
- common/ucnv.c
- common/ucnv_cb.c
- common/ucnv_cnv.c
- common/ucnv_ct.c
- common/ucnv_err.c
- common/ucnv_lmb.c
- common/ucnv_set.c
- common/ucnv_u16.c
- common/ucnv_u32.c
- common/ucnv_u7.c
- common/ucnv_u8.c
- common/ucnvdisp.c
- common/ucnvhz.c
- common/ucnvisci.c
- common/ucnvlat1.c
- common/ucnvscsu.c
- common/udatamem.c
- common/udataswp.c
- common/uenum.c
- common/uhash.c
- common/uinvchar.c
- common/ulist.c
- common/uloc_tag.c
- common/umapfile.c
- common/umath.c
- common/ures_cnv.c
- common/usc_impl.c
- common/uscript.c
- common/ustrfmt.c
- common/utf_impl.c
- common/utrace.c
- common/utypes.c
- common/wintz.c
common/appendable.cpp
common/bmpset.cpp
+ common/bmpset.h
common/brkeng.cpp
+ common/brkeng.h
common/brkiter.cpp
common/bytestream.cpp
common/bytestrie.cpp
@@ -76,291 +27,651 @@ set(
common/caniter.cpp
common/chariter.cpp
common/charstr.cpp
+ common/charstr.h
+ common/cmemory.c
+ common/cmemory.h
+ common/cpputils.h
common/cstr.cpp
+ common/cstr.h
+ common/cstring.c
+ common/cstring.h
+ common/cwchar.c
+ common/cwchar.h
common/dictbe.cpp
+ common/dictbe.h
common/dictionarydata.cpp
+ common/dictionarydata.h
common/dtintrv.cpp
common/errorcode.cpp
common/filteredbrk.cpp
common/filterednormalizer2.cpp
+ common/hash.h
+ common/icudataver.c
common/icuplug.cpp
+ common/icuplugimp.h
common/listformatter.cpp
common/loadednormalizer2impl.cpp
+ common/localsvc.h
common/locavailable.cpp
common/locbased.cpp
+ common/locbased.h
common/locdispnames.cpp
common/locdspnm.cpp
common/locid.cpp
common/loclikely.cpp
+ common/locmap.c
+ common/locmap.h
common/locresdata.cpp
common/locutil.cpp
+ common/locutil.h
+ common/messageimpl.h
common/messagepattern.cpp
+ common/msvcres.h
+ common/mutex.h
+ common/norm2_nfc_data.h
+ common/norm2allmodes.h
common/normalizer2.cpp
common/normalizer2impl.cpp
+ common/normalizer2impl.h
common/normlzr.cpp
common/parsepos.cpp
common/patternprops.cpp
+ common/patternprops.h
common/pluralmap.cpp
+ common/pluralmap.h
common/propname.cpp
+ common/propname.h
+ common/propname_data.h
+ common/propsvec.c
+ common/propsvec.h
common/punycode.cpp
+ common/punycode.h
common/putil.cpp
+ common/putilimp.h
common/rbbi.cpp
+ common/rbbicst.pl
common/rbbidata.cpp
+ common/rbbidata.h
common/rbbinode.cpp
+ common/rbbinode.h
common/rbbirb.cpp
+ common/rbbirb.h
+ common/rbbirpt.h
+ common/rbbirpt.txt
common/rbbiscan.cpp
+ common/rbbiscan.h
common/rbbisetb.cpp
+ common/rbbisetb.h
common/rbbistbl.cpp
common/rbbitblb.cpp
+ common/rbbitblb.h
common/resbund.cpp
common/resbund_cnv.cpp
common/resource.cpp
+ common/resource.h
common/ruleiter.cpp
+ common/ruleiter.h
common/schriter.cpp
common/serv.cpp
+ common/serv.h
common/servlk.cpp
common/servlkf.cpp
+ common/servloc.h
common/servls.cpp
common/servnotf.cpp
+ common/servnotf.h
common/servrbf.cpp
common/servslkf.cpp
common/sharedobject.cpp
+ common/sharedobject.h
common/simpleformatter.cpp
+ common/sprpimpl.h
common/stringpiece.cpp
common/stringtriebuilder.cpp
+ common/uarrsort.c
+ common/uarrsort.h
+ common/uassert.h
+ common/ubidi.c
+ common/ubidi_props.c
+ common/ubidi_props.h
+ common/ubidi_props_data.h
+ common/ubidiimp.h
+ common/ubidiln.c
+ common/ubidiwrt.c
common/ubrk.cpp
+ common/ubrkimpl.h
common/ucase.cpp
+ common/ucase.h
+ common/ucase_props_data.h
common/ucasemap.cpp
common/ucasemap_titlecase_brkiter.cpp
+ common/ucat.c
+ common/uchar.c
+ common/uchar_props_data.h
common/ucharstrie.cpp
common/ucharstriebuilder.cpp
common/ucharstrieiterator.cpp
common/uchriter.cpp
+ common/ucln.h
common/ucln_cmn.cpp
+ common/ucln_cmn.h
+ common/ucln_imp.h
+ common/ucmndata.c
+ common/ucmndata.h
+ common/ucnv.c
common/ucnv2022.cpp
common/ucnv_bld.cpp
+ common/ucnv_bld.h
+ common/ucnv_cb.c
+ common/ucnv_cnv.c
+ common/ucnv_cnv.h
+ common/ucnv_ct.c
+ common/ucnv_err.c
common/ucnv_ext.cpp
+ common/ucnv_ext.h
+ common/ucnv_imp.h
common/ucnv_io.cpp
+ common/ucnv_io.h
+ common/ucnv_lmb.c
+ common/ucnv_set.c
+ common/ucnv_u16.c
+ common/ucnv_u32.c
+ common/ucnv_u7.c
+ common/ucnv_u8.c
common/ucnvbocu.cpp
+ common/ucnvdisp.c
+ common/ucnvhz.c
+ common/ucnvisci.c
+ common/ucnvlat1.c
common/ucnvmbcs.cpp
+ common/ucnvmbcs.h
+ common/ucnvscsu.c
common/ucnvsel.cpp
+ common/ucol_data.h
common/ucol_swp.cpp
+ common/ucol_swp.h
common/ucurr.cpp
+ common/ucurrimp.h
common/udata.cpp
+ common/udatamem.c
+ common/udatamem.h
+ common/udataswp.c
+ common/udataswp.h
+ common/uelement.h
+ common/uenum.c
+ common/uenumimp.h
+ common/uhash.c
+ common/uhash.h
common/uhash_us.cpp
common/uidna.cpp
common/uinit.cpp
+ common/uinvchar.c
+ common/uinvchar.h
common/uiter.cpp
+ common/ulist.c
+ common/ulist.h
common/ulistformatter.cpp
common/uloc.cpp
common/uloc_keytype.cpp
+ common/uloc_tag.c
+ common/ulocimp.h
+ common/umapfile.c
+ common/umapfile.h
+ common/umath.c
common/umutex.cpp
+ common/umutex.h
common/unames.cpp
common/unifiedcache.cpp
+ common/unifiedcache.h
common/unifilt.cpp
common/unifunct.cpp
common/uniset.cpp
common/uniset_closure.cpp
common/uniset_props.cpp
common/unisetspan.cpp
+ common/unisetspan.h
common/unistr.cpp
common/unistr_case.cpp
common/unistr_case_locale.cpp
common/unistr_cnv.cpp
common/unistr_props.cpp
common/unistr_titlecase_brkiter.cpp
+ common/unistrappender.h
common/unorm.cpp
common/unormcmp.cpp
+ common/unormimp.h
common/uobject.cpp
+ common/uposixdefs.h
common/uprops.cpp
+ common/uprops.h
+ common/ures_cnv.c
common/uresbund.cpp
common/uresdata.cpp
+ common/uresdata.h
+ common/uresimp.h
+ common/ureslocs.h
+ common/usc_impl.c
+ common/usc_impl.h
+ common/uscript.c
common/uscript_props.cpp
common/uset.cpp
+ common/uset_imp.h
common/uset_props.cpp
common/usetiter.cpp
common/ushape.cpp
common/usprep.cpp
common/ustack.cpp
common/ustr_cnv.cpp
+ common/ustr_cnv.h
+ common/ustr_imp.h
common/ustr_titlecase_brkiter.cpp
common/ustr_wcs.cpp
common/ustrcase.cpp
common/ustrcase_locale.cpp
common/ustrenum.cpp
+ common/ustrenum.h
+ common/ustrfmt.c
+ common/ustrfmt.h
common/ustring.cpp
common/ustrtrns.cpp
common/utext.cpp
+ common/utf_impl.c
common/util.cpp
+ common/util.h
common/util_props.cpp
+ common/utrace.c
+ common/utracimp.h
common/utrie.cpp
+ common/utrie.h
common/utrie2.cpp
+ common/utrie2.h
common/utrie2_builder.cpp
+ common/utrie2_impl.h
common/uts46.cpp
+ common/utypeinfo.h
+ common/utypes.c
common/uvector.cpp
+ common/uvector.h
common/uvectr32.cpp
+ common/uvectr32.h
common/uvectr64.cpp
- i18n/decContext.c
- i18n/decNumber.c
- i18n/ulocdata.c
- i18n/utmscale.c
+ common/uvectr64.h
+ common/wintz.c
+ common/wintz.h
+ common/unicode/appendable.h
+ common/unicode/brkiter.h
+ common/unicode/bytestream.h
+ common/unicode/bytestrie.h
+ common/unicode/bytestriebuilder.h
+ common/unicode/caniter.h
+ common/unicode/chariter.h
+ common/unicode/dbbi.h
+ common/unicode/docmain.h
+ common/unicode/dtintrv.h
+ common/unicode/enumset.h
+ common/unicode/errorcode.h
+ common/unicode/filteredbrk.h
+ common/unicode/icudataver.h
+ common/unicode/icuplug.h
+ common/unicode/idna.h
+ common/unicode/listformatter.h
+ common/unicode/localpointer.h
+ common/unicode/locdspnm.h
+ common/unicode/locid.h
+ common/unicode/messagepattern.h
+ common/unicode/normalizer2.h
+ common/unicode/normlzr.h
+ common/unicode/parseerr.h
+ common/unicode/parsepos.h
+ common/unicode/platform.h
+ common/unicode/ptypes.h
+ common/unicode/putil.h
+ common/unicode/rbbi.h
+ common/unicode/rep.h
+ common/unicode/resbund.h
+ common/unicode/schriter.h
+ common/unicode/simpleformatter.h
+ common/unicode/std_string.h
+ common/unicode/strenum.h
+ common/unicode/stringpiece.h
+ common/unicode/stringtriebuilder.h
+ common/unicode/symtable.h
+ common/unicode/ubidi.h
+ common/unicode/ubrk.h
+ common/unicode/ucasemap.h
+ common/unicode/ucat.h
+ common/unicode/uchar.h
+ common/unicode/ucharstrie.h
+ common/unicode/ucharstriebuilder.h
+ common/unicode/uchriter.h
+ common/unicode/uclean.h
+ common/unicode/ucnv.h
+ common/unicode/ucnv_cb.h
+ common/unicode/ucnv_err.h
+ common/unicode/ucnvsel.h
+ common/unicode/uconfig.h
+ common/unicode/ucurr.h
+ common/unicode/udata.h
+ common/unicode/udisplaycontext.h
+ common/unicode/uenum.h
+ common/unicode/uidna.h
+ common/unicode/uiter.h
+ common/unicode/uldnames.h
+ common/unicode/ulistformatter.h
+ common/unicode/uloc.h
+ common/unicode/umachine.h
+ common/unicode/umisc.h
+ common/unicode/unifilt.h
+ common/unicode/unifunct.h
+ common/unicode/unimatch.h
+ common/unicode/uniset.h
+ common/unicode/unistr.h
+ common/unicode/unorm.h
+ common/unicode/unorm2.h
+ common/unicode/uobject.h
+ common/unicode/urename.h
+ common/unicode/urep.h
+ common/unicode/ures.h
+ common/unicode/uscript.h
+ common/unicode/uset.h
+ common/unicode/usetiter.h
+ common/unicode/ushape.h
+ common/unicode/usprep.h
+ common/unicode/ustring.h
+ common/unicode/ustringtrie.h
+ common/unicode/utext.h
+ common/unicode/utf.h
+ common/unicode/utf16.h
+ common/unicode/utf32.h
+ common/unicode/utf8.h
+ common/unicode/utf_old.h
+ common/unicode/utrace.h
+ common/unicode/utypes.h
+ common/unicode/uvernum.h
+ common/unicode/uversion.h
i18n/affixpatternparser.cpp
+ i18n/affixpatternparser.h
i18n/alphaindex.cpp
i18n/anytrans.cpp
+ i18n/anytrans.h
i18n/astro.cpp
+ i18n/astro.h
i18n/basictz.cpp
i18n/bocsu.cpp
+ i18n/bocsu.h
i18n/brktrans.cpp
+ i18n/brktrans.h
i18n/buddhcal.cpp
+ i18n/buddhcal.h
i18n/calendar.cpp
i18n/casetrn.cpp
+ i18n/casetrn.h
i18n/cecal.cpp
+ i18n/cecal.h
i18n/chnsecal.cpp
+ i18n/chnsecal.h
i18n/choicfmt.cpp
i18n/coleitr.cpp
i18n/coll.cpp
i18n/collation.cpp
+ i18n/collation.h
i18n/collationbuilder.cpp
+ i18n/collationbuilder.h
i18n/collationcompare.cpp
+ i18n/collationcompare.h
i18n/collationdata.cpp
+ i18n/collationdata.h
i18n/collationdatabuilder.cpp
+ i18n/collationdatabuilder.h
i18n/collationdatareader.cpp
+ i18n/collationdatareader.h
i18n/collationdatawriter.cpp
+ i18n/collationdatawriter.h
i18n/collationfastlatin.cpp
+ i18n/collationfastlatin.h
i18n/collationfastlatinbuilder.cpp
+ i18n/collationfastlatinbuilder.h
i18n/collationfcd.cpp
+ i18n/collationfcd.h
i18n/collationiterator.cpp
+ i18n/collationiterator.h
i18n/collationkeys.cpp
+ i18n/collationkeys.h
i18n/collationroot.cpp
+ i18n/collationroot.h
i18n/collationrootelements.cpp
+ i18n/collationrootelements.h
i18n/collationruleparser.cpp
+ i18n/collationruleparser.h
i18n/collationsets.cpp
+ i18n/collationsets.h
i18n/collationsettings.cpp
+ i18n/collationsettings.h
i18n/collationtailoring.cpp
+ i18n/collationtailoring.h
i18n/collationweights.cpp
+ i18n/collationweights.h
+ i18n/collunsafe.h
i18n/compactdecimalformat.cpp
i18n/coptccal.cpp
+ i18n/coptccal.h
i18n/cpdtrans.cpp
+ i18n/cpdtrans.h
i18n/csdetect.cpp
+ i18n/csdetect.h
i18n/csmatch.cpp
+ i18n/csmatch.h
i18n/csr2022.cpp
+ i18n/csr2022.h
i18n/csrecog.cpp
+ i18n/csrecog.h
i18n/csrmbcs.cpp
+ i18n/csrmbcs.h
i18n/csrsbcs.cpp
+ i18n/csrsbcs.h
i18n/csrucode.cpp
+ i18n/csrucode.h
i18n/csrutf8.cpp
+ i18n/csrutf8.h
i18n/curramt.cpp
i18n/currfmt.cpp
+ i18n/currfmt.h
i18n/currpinf.cpp
i18n/currunit.cpp
i18n/dangical.cpp
+ i18n/dangical.h
i18n/datefmt.cpp
i18n/dayperiodrules.cpp
+ i18n/dayperiodrules.h
+ i18n/dcfmtimp.h
i18n/dcfmtsym.cpp
+ i18n/decContext.c
+ i18n/decContext.h
i18n/decfmtst.cpp
+ i18n/decfmtst.h
i18n/decimalformatpattern.cpp
+ i18n/decimalformatpattern.h
+ i18n/decimalformatpatternimpl.h
i18n/decimfmt.cpp
i18n/decimfmtimpl.cpp
+ i18n/decimfmtimpl.h
+ i18n/decNumber.c
+ i18n/decNumber.h
+ i18n/decNumberLocal.h
i18n/digitaffix.cpp
+ i18n/digitaffix.h
i18n/digitaffixesandpadding.cpp
+ i18n/digitaffixesandpadding.h
i18n/digitformatter.cpp
+ i18n/digitformatter.h
i18n/digitgrouping.cpp
+ i18n/digitgrouping.h
i18n/digitinterval.cpp
+ i18n/digitinterval.h
i18n/digitlst.cpp
+ i18n/digitlst.h
i18n/dtfmtsym.cpp
+ i18n/dtitv_impl.h
i18n/dtitvfmt.cpp
i18n/dtitvinf.cpp
i18n/dtptngen.cpp
+ i18n/dtptngen_impl.h
i18n/dtrule.cpp
i18n/esctrn.cpp
+ i18n/esctrn.h
i18n/ethpccal.cpp
+ i18n/ethpccal.h
i18n/fmtable.cpp
i18n/fmtable_cnv.cpp
+ i18n/fmtableimp.h
i18n/format.cpp
i18n/fphdlimp.cpp
+ i18n/fphdlimp.h
i18n/fpositer.cpp
i18n/funcrepl.cpp
+ i18n/funcrepl.h
i18n/gender.cpp
i18n/gregocal.cpp
i18n/gregoimp.cpp
+ i18n/gregoimp.h
i18n/hebrwcal.cpp
+ i18n/hebrwcal.h
i18n/identifier_info.cpp
+ i18n/identifier_info.h
i18n/indiancal.cpp
+ i18n/indiancal.h
i18n/inputext.cpp
+ i18n/inputext.h
i18n/islamcal.cpp
+ i18n/islamcal.h
i18n/japancal.cpp
+ i18n/japancal.h
i18n/measfmt.cpp
i18n/measunit.cpp
i18n/measure.cpp
i18n/msgfmt.cpp
+ i18n/msgfmt_impl.h
i18n/name2uni.cpp
+ i18n/name2uni.h
+ i18n/nfrlist.h
i18n/nfrs.cpp
+ i18n/nfrs.h
i18n/nfrule.cpp
+ i18n/nfrule.h
i18n/nfsubs.cpp
+ i18n/nfsubs.h
i18n/nortrans.cpp
+ i18n/nortrans.h
i18n/nultrans.cpp
+ i18n/nultrans.h
i18n/numfmt.cpp
i18n/numsys.cpp
+ i18n/numsys_impl.h
i18n/olsontz.cpp
+ i18n/olsontz.h
i18n/persncal.cpp
+ i18n/persncal.h
i18n/pluralaffix.cpp
+ i18n/pluralaffix.h
i18n/plurfmt.cpp
i18n/plurrule.cpp
+ i18n/plurrule_impl.h
i18n/precision.cpp
+ i18n/precision.h
i18n/quant.cpp
+ i18n/quant.h
i18n/quantityformatter.cpp
+ i18n/quantityformatter.h
i18n/rbnf.cpp
i18n/rbt.cpp
+ i18n/rbt.h
i18n/rbt_data.cpp
+ i18n/rbt_data.h
i18n/rbt_pars.cpp
+ i18n/rbt_pars.h
i18n/rbt_rule.cpp
+ i18n/rbt_rule.h
i18n/rbt_set.cpp
+ i18n/rbt_set.h
i18n/rbtz.cpp
i18n/regexcmp.cpp
+ i18n/regexcmp.h
+ i18n/regexcst.h
+ i18n/regexcst.pl
+ i18n/regexcst.txt
i18n/regeximp.cpp
+ i18n/regeximp.h
i18n/regexst.cpp
+ i18n/regexst.h
i18n/regextxt.cpp
+ i18n/regextxt.h
i18n/region.cpp
+ i18n/region_impl.h
i18n/reldatefmt.cpp
i18n/reldtfmt.cpp
+ i18n/reldtfmt.h
i18n/rematch.cpp
i18n/remtrans.cpp
+ i18n/remtrans.h
i18n/repattrn.cpp
i18n/rulebasedcollator.cpp
i18n/scientificnumberformatter.cpp
i18n/scriptset.cpp
+ i18n/scriptset.h
i18n/search.cpp
i18n/selfmt.cpp
+ i18n/selfmtimpl.h
i18n/sharedbreakiterator.cpp
+ i18n/sharedbreakiterator.h
+ i18n/sharedcalendar.h
+ i18n/shareddateformatsymbols.h
+ i18n/sharednumberformat.h
+ i18n/sharedpluralrules.h
+ i18n/significantdigitinterval.h
i18n/simpletz.cpp
i18n/smallintformatter.cpp
+ i18n/smallintformatter.h
i18n/smpdtfmt.cpp
i18n/smpdtfst.cpp
+ i18n/smpdtfst.h
i18n/sortkey.cpp
i18n/standardplural.cpp
+ i18n/standardplural.h
i18n/strmatch.cpp
+ i18n/strmatch.h
i18n/strrepl.cpp
+ i18n/strrepl.h
i18n/stsearch.cpp
i18n/taiwncal.cpp
+ i18n/taiwncal.h
i18n/timezone.cpp
i18n/titletrn.cpp
+ i18n/titletrn.h
i18n/tmunit.cpp
i18n/tmutamt.cpp
i18n/tmutfmt.cpp
i18n/tolowtrn.cpp
+ i18n/tolowtrn.h
i18n/toupptrn.cpp
+ i18n/toupptrn.h
i18n/translit.cpp
i18n/transreg.cpp
+ i18n/transreg.h
i18n/tridpars.cpp
+ i18n/tridpars.h
i18n/tzfmt.cpp
i18n/tzgnames.cpp
+ i18n/tzgnames.h
i18n/tznames.cpp
i18n/tznames_impl.cpp
+ i18n/tznames_impl.h
i18n/tzrule.cpp
i18n/tztrans.cpp
i18n/ucal.cpp
i18n/ucln_in.cpp
+ i18n/ucln_in.h
i18n/ucol.cpp
+ i18n/ucol_imp.h
i18n/ucol_res.cpp
i18n/ucol_sit.cpp
i18n/ucoleitr.cpp
@@ -370,9 +681,14 @@ set(
i18n/udatpg.cpp
i18n/ufieldpositer.cpp
i18n/uitercollationiterator.cpp
+ i18n/uitercollationiterator.h
+ i18n/ulocdata.c
i18n/umsg.cpp
+ i18n/umsg_imp.h
i18n/unesctrn.cpp
+ i18n/unesctrn.h
i18n/uni2name.cpp
+ i18n/uni2name.h
i18n/unum.cpp
i18n/unumsys.cpp
i18n/upluralrules.cpp
@@ -383,215 +699,37 @@ set(
i18n/uspoof.cpp
i18n/uspoof_build.cpp
i18n/uspoof_conf.cpp
+ i18n/uspoof_conf.h
i18n/uspoof_impl.cpp
+ i18n/uspoof_impl.h
i18n/uspoof_wsconf.cpp
+ i18n/uspoof_wsconf.h
+ i18n/usrchimp.h
i18n/utf16collationiterator.cpp
+ i18n/utf16collationiterator.h
i18n/utf8collationiterator.cpp
+ i18n/utf8collationiterator.h
+ i18n/utmscale.c
i18n/utrans.cpp
i18n/valueformatter.cpp
+ i18n/valueformatter.h
i18n/visibledigits.cpp
+ i18n/visibledigits.h
i18n/vtzone.cpp
i18n/vzone.cpp
+ i18n/vzone.h
i18n/windtfmt.cpp
+ i18n/windtfmt.h
i18n/winnmfmt.cpp
+ i18n/winnmfmt.h
i18n/wintzimpl.cpp
+ i18n/wintzimpl.h
i18n/zonemeta.cpp
+ i18n/zonemeta.h
i18n/zrule.cpp
+ i18n/zrule.h
i18n/ztrans.cpp
- stubdata/stubdata.c
-
- common/unicode/appendable.h
- common/unicode/brkiter.h
- common/unicode/bytestream.h
- common/unicode/bytestrie.h
- common/unicode/bytestriebuilder.h
- common/unicode/caniter.h
- common/unicode/chariter.h
- common/unicode/dbbi.h
- common/unicode/docmain.h
- common/unicode/dtintrv.h
- common/unicode/enumset.h
- common/unicode/errorcode.h
- common/unicode/filteredbrk.h
- common/unicode/icudataver.h
- common/unicode/icuplug.h
- common/unicode/idna.h
- common/unicode/listformatter.h
- common/unicode/localpointer.h
- common/unicode/locdspnm.h
- common/unicode/locid.h
- common/unicode/messagepattern.h
- common/unicode/normalizer2.h
- common/unicode/normlzr.h
- common/unicode/parseerr.h
- common/unicode/parsepos.h
- common/unicode/platform.h
- common/unicode/ptypes.h
- common/unicode/putil.h
- common/unicode/rbbi.h
- common/unicode/rep.h
- common/unicode/resbund.h
- common/unicode/schriter.h
- common/unicode/simpleformatter.h
- common/unicode/std_string.h
- common/unicode/strenum.h
- common/unicode/stringpiece.h
- common/unicode/stringtriebuilder.h
- common/unicode/symtable.h
- common/unicode/ubidi.h
- common/unicode/ubrk.h
- common/unicode/ucasemap.h
- common/unicode/ucat.h
- common/unicode/uchar.h
- common/unicode/ucharstrie.h
- common/unicode/ucharstriebuilder.h
- common/unicode/uchriter.h
- common/unicode/uclean.h
- common/unicode/ucnv.h
- common/unicode/ucnv_cb.h
- common/unicode/ucnv_err.h
- common/unicode/ucnvsel.h
- common/unicode/uconfig.h
- common/unicode/ucurr.h
- common/unicode/udata.h
- common/unicode/udisplaycontext.h
- common/unicode/uenum.h
- common/unicode/uidna.h
- common/unicode/uiter.h
- common/unicode/uldnames.h
- common/unicode/ulistformatter.h
- common/unicode/uloc.h
- common/unicode/umachine.h
- common/unicode/umisc.h
- common/unicode/unifilt.h
- common/unicode/unifunct.h
- common/unicode/unimatch.h
- common/unicode/uniset.h
- common/unicode/unistr.h
- common/unicode/unorm.h
- common/unicode/unorm2.h
- common/unicode/uobject.h
- common/unicode/urename.h
- common/unicode/urep.h
- common/unicode/ures.h
- common/unicode/uscript.h
- common/unicode/uset.h
- common/unicode/usetiter.h
- common/unicode/ushape.h
- common/unicode/usprep.h
- common/unicode/ustring.h
- common/unicode/ustringtrie.h
- common/unicode/utext.h
- common/unicode/utf.h
- common/unicode/utf16.h
- common/unicode/utf32.h
- common/unicode/utf8.h
- common/unicode/utf_old.h
- common/unicode/utrace.h
- common/unicode/utypes.h
- common/unicode/uvernum.h
- common/unicode/uversion.h
- common/bmpset.h
- common/brkeng.h
- common/charstr.h
- common/cmemory.h
- common/common.rc
- common/cpputils.h
- common/cstr.h
- common/cstring.h
- common/cwchar.h
- common/dictbe.h
- common/dictionarydata.h
- common/hash.h
- common/icuplugimp.h
- common/localsvc.h
- common/locbased.h
- common/locmap.h
- common/locutil.h
- common/messageimpl.h
- common/msvcres.h
- common/mutex.h
- common/norm2_nfc_data.h
- common/norm2allmodes.h
- common/normalizer2impl.h
- common/patternprops.h
- common/pluralmap.h
- common/propname.h
- common/propname_data.h
- common/propsvec.h
- common/punycode.h
- common/putilimp.h
- common/rbbidata.h
- common/rbbinode.h
- common/rbbirb.h
- common/rbbirpt.h
- common/rbbiscan.h
- common/rbbisetb.h
- common/rbbitblb.h
- common/resource.h
- common/ruleiter.h
- common/serv.h
- common/servloc.h
- common/servnotf.h
- common/sharedobject.h
- common/sprpimpl.h
- common/uarrsort.h
- common/uassert.h
- common/ubidi_props.h
- common/ubidi_props_data.h
- common/ubidiimp.h
- common/ubrkimpl.h
- common/ucase.h
- common/ucase_props_data.h
- common/uchar_props_data.h
- common/ucln.h
- common/ucln_cmn.h
- common/ucln_imp.h
- common/ucmndata.h
- common/ucnv_bld.h
- common/ucnv_cnv.h
- common/ucnv_ext.h
- common/ucnv_imp.h
- common/ucnv_io.h
- common/ucnvmbcs.h
- common/ucol_data.h
- common/ucol_swp.h
- common/ucurrimp.h
- common/udatamem.h
- common/udataswp.h
- common/uelement.h
- common/uenumimp.h
- common/uhash.h
- common/uinvchar.h
- common/ulist.h
- common/ulocimp.h
- common/umapfile.h
- common/umutex.h
- common/unifiedcache.h
- common/unisetspan.h
- common/unistrappender.h
- common/unormimp.h
- common/uposixdefs.h
- common/uprops.h
- common/uresdata.h
- common/uresimp.h
- common/ureslocs.h
- common/usc_impl.h
- common/uset_imp.h
- common/ustr_cnv.h
- common/ustr_imp.h
- common/ustrenum.h
- common/ustrfmt.h
- common/util.h
- common/utracimp.h
- common/utrie.h
- common/utrie2.h
- common/utrie2_impl.h
- common/utypeinfo.h
- common/uvector.h
- common/uvectr32.h
- common/uvectr64.h
- common/wintz.h
+ i18n/ztrans.h
i18n/unicode/alphaindex.h
i18n/unicode/basictz.h
i18n/unicode/calendar.h
@@ -670,147 +808,7 @@ set(
i18n/unicode/utmscale.h
i18n/unicode/utrans.h
i18n/unicode/vtzone.h
- i18n/affixpatternparser.h
- i18n/anytrans.h
- i18n/astro.h
- i18n/bocsu.h
- i18n/brktrans.h
- i18n/buddhcal.h
- i18n/casetrn.h
- i18n/cecal.h
- i18n/chnsecal.h
- i18n/collation.h
- i18n/collationbuilder.h
- i18n/collationcompare.h
- i18n/collationdata.h
- i18n/collationdatabuilder.h
- i18n/collationdatareader.h
- i18n/collationdatawriter.h
- i18n/collationfastlatin.h
- i18n/collationfastlatinbuilder.h
- i18n/collationfcd.h
- i18n/collationiterator.h
- i18n/collationkeys.h
- i18n/collationroot.h
- i18n/collationrootelements.h
- i18n/collationruleparser.h
- i18n/collationsets.h
- i18n/collationsettings.h
- i18n/collationtailoring.h
- i18n/collationweights.h
- i18n/collunsafe.h
- i18n/coptccal.h
- i18n/cpdtrans.h
- i18n/csdetect.h
- i18n/csmatch.h
- i18n/csr2022.h
- i18n/csrecog.h
- i18n/csrmbcs.h
- i18n/csrsbcs.h
- i18n/csrucode.h
- i18n/csrutf8.h
- i18n/currfmt.h
- i18n/dangical.h
- i18n/dayperiodrules.h
- i18n/dcfmtimp.h
- i18n/decContext.h
- i18n/decfmtst.h
- i18n/decimalformatpattern.h
- i18n/decimalformatpatternimpl.h
- i18n/decimfmtimpl.h
- i18n/decNumber.h
- i18n/decNumberLocal.h
- i18n/digitaffix.h
- i18n/digitaffixesandpadding.h
- i18n/digitformatter.h
- i18n/digitgrouping.h
- i18n/digitinterval.h
- i18n/digitlst.h
- i18n/dtitv_impl.h
- i18n/dtptngen_impl.h
- i18n/esctrn.h
- i18n/ethpccal.h
- i18n/fmtableimp.h
- i18n/fphdlimp.h
- i18n/funcrepl.h
- i18n/gregoimp.h
- i18n/hebrwcal.h
- i18n/identifier_info.h
- i18n/indiancal.h
- i18n/inputext.h
- i18n/islamcal.h
- i18n/japancal.h
- i18n/msgfmt_impl.h
- i18n/name2uni.h
- i18n/nfrlist.h
- i18n/nfrs.h
- i18n/nfrule.h
- i18n/nfsubs.h
- i18n/nortrans.h
- i18n/nultrans.h
- i18n/numsys_impl.h
- i18n/olsontz.h
- i18n/persncal.h
- i18n/pluralaffix.h
- i18n/plurrule_impl.h
- i18n/precision.h
- i18n/quant.h
- i18n/quantityformatter.h
- i18n/rbt.h
- i18n/rbt_data.h
- i18n/rbt_pars.h
- i18n/rbt_rule.h
- i18n/rbt_set.h
- i18n/regexcmp.h
- i18n/regexcst.h
- i18n/regeximp.h
- i18n/regexst.h
- i18n/regextxt.h
- i18n/region_impl.h
- i18n/reldtfmt.h
- i18n/remtrans.h
- i18n/scriptset.h
- i18n/selfmtimpl.h
- i18n/sharedbreakiterator.h
- i18n/sharedcalendar.h
- i18n/shareddateformatsymbols.h
- i18n/sharednumberformat.h
- i18n/sharedpluralrules.h
- i18n/significantdigitinterval.h
- i18n/smallintformatter.h
- i18n/smpdtfst.h
- i18n/standardplural.h
- i18n/strmatch.h
- i18n/strrepl.h
- i18n/taiwncal.h
- i18n/titletrn.h
- i18n/tolowtrn.h
- i18n/toupptrn.h
- i18n/transreg.h
- i18n/tridpars.h
- i18n/tzgnames.h
- i18n/tznames_impl.h
- i18n/ucln_in.h
- i18n/ucol_imp.h
- i18n/uitercollationiterator.h
- i18n/umsg_imp.h
- i18n/unesctrn.h
- i18n/uni2name.h
- i18n/uspoof_conf.h
- i18n/uspoof_impl.h
- i18n/uspoof_wsconf.h
- i18n/usrchimp.h
- i18n/utf16collationiterator.h
- i18n/utf8collationiterator.h
- i18n/valueformatter.h
- i18n/visibledigits.h
- i18n/vzone.h
- i18n/windtfmt.h
- i18n/winnmfmt.h
- i18n/wintzimpl.h
- i18n/zonemeta.h
- i18n/zrule.h
- i18n/ztrans.h
+ stubdata/stubdata.c
)
add_library(${PROJECT_NAME} ${SRC})
diff --git a/coding/CMakeLists.txt b/coding/CMakeLists.txt
index 52ae94df7b..908c2d0fb6 100644
--- a/coding/CMakeLists.txt
+++ b/coding/CMakeLists.txt
@@ -71,8 +71,8 @@ set(
succinct_mapper.hpp
traffic.cpp
traffic.hpp
- transliterator.cpp
- transliterator.hpp
+ transliteration.cpp
+ transliteration.hpp
uri.cpp
uri.hpp
url_encode.hpp
diff --git a/coding/multilang_utf8_string.cpp b/coding/multilang_utf8_string.cpp
index 369ffdb9a0..9e3211501a 100644
--- a/coding/multilang_utf8_string.cpp
+++ b/coding/multilang_utf8_string.cpp
@@ -10,37 +10,71 @@ namespace
// Note, that it's not feasible to increase languages number here due to
// our current encoding (6 bit to store language code).
StringUtf8Multilang::Languages const g_languages = {{
- {"default", "Native for each country", "Any-Latin"},
- {"en", "English", ""}, {"ja", "日本語", ""}, {"fr", "Français", ""},
- {"ko_rm", "Korean (Romanized)", "Korean-Latin/BGN"}, {"ar", "العربية", "Any-Latin"},
- {"de", "Deutsch", ""}, {"int_name", "International (Latin)", "Any-Latin"},
- {"ru", "Русский", "Russian-Latin/BGN"}, {"sv", "Svenska", "Any-Latin"},
- {"zh", "中文", "Any-Latin"}, {"fi", "Suomi", "Any-Latin"},
- {"be", "Беларуская", "Belarusian-Latin/BGN"}, {"ka", "ქართული", "Georgian-Latin"},
- {"ko", "한국어", "Hangul-Latin/BGN"}, {"he", "עברית", "Hebrew-Latin/BGN"}, {"nl", "Nederlands", ""},
- {"ga", "Gaeilge", "Any-Latin"}, {"ja_rm", "Japanese (Romanized)", "Any-Latin"},
- {"el", "Ελληνικά", "Greek-Latin"}, {"it", "Italiano", ""}, {"es", "Español", ""},
- {"zh_pinyin", "Chinese (Pinyin)", "Any-Latin"}, {"th", "ไทย", "Thai-Latin"},
- {"cy", "Cymraeg", "Any-Latin"}, {"sr", "Српски", "Serbian-Latin/BGN"},
- {"uk", "Українська", "Ukrainian-Latin/BGN"}, {"ca", "Català", "Any-Latin"},
- {"hu", "Magyar", "Any-Latin"}, {"hsb", "Hornjoserbšćina", "Any-Latin"},
- {"eu", "Euskara", "Any-Latin"}, {"fa", "فارسی", "Any-Latin"}, {"br", "Breton", "Any-Latin"},
- {"pl", "Polski", "Any-Latin"}, {"hy", "Հայերէն", "Armenian-Latin"},
- {"kn", "ಕನ್ನಡ", "Kannada-Latin"}, {"sl", "Slovenščina", "Any-Latin"},
- {"ro", "Română", "Any-Latin"}, {"sq", "Shqipe", "Any-Latin"},
- {"am", "አማርኛ", "Amharic-Latin/BGN"}, {"fy", "Frysk", "Any-Latin"},
- {"cs", "Čeština", "Any-Latin"}, {"gd", "Gàidhlig", "Any-Latin"},
- {"sk", "Slovenčina", "Any-Latin"}, {"af", "Afrikaans", "Any-Latin"},
- {"ja_kana", "日本語(カタカナ)", "Katakana-Latin"}, {"lb", "Luxembourgish", "Any-Latin"},
- {"pt", "Português", "Any-Latin"}, {"hr", "Hrvatski", "Any-Latin"},
- {"fur", "Friulian", "Any-Latin"}, {"vi", "Tiếng Việt", "Any-Latin"},
- {"tr", "Türkçe", "Any-Latin"}, {"bg", "Български", "Bulgarian-Latin/BGN"},
- {"eo", "Esperanto", "Any-Latin"}, {"lt", "Lietuvių", "Any-Latin"}, {"la", "Latin", ""},
- {"kk", "Қазақ", "Kazakh-Latin/BGN"}, {"gsw", "Schwiizertüütsch", "Any-Latin"},
- {"et", "Eesti", "Any-Latin"}, {"ku", "Kurdish", "Any-Latin"},
- {"mn", "Mongolian", "Mongolian-Latin/BGN"}, {"mk", "Македонски", "Macedonian-Latin/BGN"},
- {"lv", "Latviešu", "Any-Latin"}, {"hi", "हिन्दी", "Any-Latin"}
- }};
+ {"default", "Native for each country", "Any-Latin"},
+ {"en", "English", ""},
+ {"ja", "日本語", ""},
+ {"fr", "Français", ""},
+ {"ko_rm", "Korean (Romanized)", "Korean-Latin/BGN"},
+ {"ar", "العربية", "Any-Latin"},
+ {"de", "Deutsch", ""},
+ {"int_name", "International (Latin)", "Any-Latin"},
+ {"ru", "Русский", "Russian-Latin/BGN"},
+ {"sv", "Svenska", "Any-Latin"},
+ {"zh", "中文", "Any-Latin"},
+ {"fi", "Suomi", "Any-Latin"},
+ {"be", "Беларуская", "Belarusian-Latin/BGN"},
+ {"ka", "ქართული", "Georgian-Latin"},
+ {"ko", "한국어", "Hangul-Latin/BGN"},
+ {"he", "עברית", "Hebrew-Latin/BGN"},
+ {"nl", "Nederlands", ""},
+ {"ga", "Gaeilge", "Any-Latin"},
+ {"ja_rm", "Japanese (Romanized)", "Any-Latin"},
+ {"el", "Ελληνικά", "Greek-Latin"},
+ {"it", "Italiano", ""},
+ {"es", "Español", ""},
+ {"zh_pinyin", "Chinese (Pinyin)", "Any-Latin"},
+ {"th", "ไทย", "Thai-Latin"},
+ {"cy", "Cymraeg", "Any-Latin"},
+ {"sr", "Српски", "Serbian-Latin/BGN"},
+ {"uk", "Українська", "Ukrainian-Latin/BGN"},
+ {"ca", "Català", "Any-Latin"},
+ {"hu", "Magyar", "Any-Latin"},
+ {"hsb", "Hornjoserbšćina", "Any-Latin"},
+ {"eu", "Euskara", "Any-Latin"},
+ {"fa", "فارسی", "Any-Latin"},
+ {"br", "Breton", "Any-Latin"},
+ {"pl", "Polski", "Any-Latin"},
+ {"hy", "Հայերէն", "Armenian-Latin"},
+ {"kn", "ಕನ್ನಡ", "Kannada-Latin"},
+ {"sl", "Slovenščina", "Any-Latin"},
+ {"ro", "Română", "Any-Latin"},
+ {"sq", "Shqipe", "Any-Latin"},
+ {"am", "አማርኛ", "Amharic-Latin/BGN"},
+ {"fy", "Frysk", "Any-Latin"},
+ {"cs", "Čeština", "Any-Latin"},
+ {"gd", "Gàidhlig", "Any-Latin"},
+ {"sk", "Slovenčina", "Any-Latin"},
+ {"af", "Afrikaans", "Any-Latin"},
+ {"ja_kana", "日本語(カタカナ)", "Katakana-Latin"},
+ {"lb", "Luxembourgish", "Any-Latin"},
+ {"pt", "Português", "Any-Latin"},
+ {"hr", "Hrvatski", "Any-Latin"},
+ {"fur", "Friulian", "Any-Latin"},
+ {"vi", "Tiếng Việt", "Any-Latin"},
+ {"tr", "Türkçe", "Any-Latin"},
+ {"bg", "Български", "Bulgarian-Latin/BGN"},
+ {"eo", "Esperanto", "Any-Latin"},
+ {"lt", "Lietuvių", "Any-Latin"},
+ {"la", "Latin", ""},
+ {"kk", "Қазақ", "Kazakh-Latin/BGN"},
+ {"gsw", "Schwiizertüütsch", "Any-Latin"},
+ {"et", "Eesti", "Any-Latin"},
+ {"ku", "Kurdish", "Any-Latin"},
+ {"mn", "Mongolian", "Mongolian-Latin/BGN"},
+ {"mk", "Македонски", "Macedonian-Latin/BGN"},
+ {"lv", "Latviešu", "Any-Latin"},
+ {"hi", "हिन्दी", "Any-Latin"}
+}};
static_assert(g_languages.size() == StringUtf8Multilang::kMaxSupportedLanguages,
"With current encoding we are limited to 64 languages max.");
diff --git a/coding/transliteration.cpp b/coding/transliteration.cpp
index c1a9ab1138..e30a03820a 100644
--- a/coding/transliteration.cpp
+++ b/coding/transliteration.cpp
@@ -15,11 +15,12 @@ Transliteration::~Transliteration()
// but it should be called only once for performance reasons.
// The primary benefit is to eliminate reports of memory or resource leaks originating
// in ICU code from the results generated by heap analysis tools.
+ // http://www.icu-project.org/apiref/icu4c/uclean_8h.html#a93f27d0ddc7c196a1da864763f2d8920
m_transliterators.clear();
u_cleanup();
}
-Transliteration & Transliteration::GetInstance()
+Transliteration & Transliteration::Instance()
{
static Transliteration instance;
return instance;
@@ -45,21 +46,25 @@ void Transliteration::Init(std::string const & icuDataDir)
}
}
-std::string Transliteration::Transliterate(std::string const & str, int8_t langCode) const
+bool Transliteration::Transliterate(std::string const & str, int8_t langCode, std::string & out) const
{
+ if (str.empty())
+ return false;
+
auto const transliteratorId = StringUtf8Multilang::GetTransliteratorIdByCode(langCode);
auto const & it = m_transliterators.find(transliteratorId);
if (it == m_transliterators.end())
{
LOG(LWARNING, ("Transliteration failed, unknown transliterator \"", transliteratorId, "\""));
- return "";
+ return false;
}
UnicodeString ustr(str.c_str());
it->second->transliterate(ustr);
- std::string resultStr;
- ustr.toUTF8String(resultStr);
+ if (ustr.isEmpty())
+ return false;
- return resultStr;
+ ustr.toUTF8String(out);
+ return true;
}
diff --git a/coding/transliteration.hpp b/coding/transliteration.hpp
index 04dd75b6c3..cc3f97eb4d 100644
--- a/coding/transliteration.hpp
+++ b/coding/transliteration.hpp
@@ -14,11 +14,11 @@ class Transliteration
public:
~Transliteration();
- static Transliteration & GetInstance();
+ static Transliteration & Instance();
void Init(std::string const & icuDataDir);
- std::string Transliterate(std::string const & str, int8_t langCode) const;
+ bool Transliterate(std::string const & str, int8_t langCode, std::string & out) const;
private:
Transliteration() = default;
diff --git a/generator/srtm_coverage_checker/srtm_coverage_checker.pro b/generator/srtm_coverage_checker/srtm_coverage_checker.pro
index 7099b7b5a9..3f15a6665a 100644
--- a/generator/srtm_coverage_checker/srtm_coverage_checker.pro
+++ b/generator/srtm_coverage_checker/srtm_coverage_checker.pro
@@ -7,8 +7,8 @@ CONFIG -= app_bundle
TEMPLATE = app
ROOT_DIR = ../..
-DEPENDENCIES = generator map routing routing_common search storage icu indexer platform editor geometry coding base \
- osrm jansson protobuf succinct stats_client pugixml minizip gflags stats_client
+DEPENDENCIES = generator map routing routing_common search storage indexer platform editor geometry coding base \
+ osrm jansson protobuf succinct stats_client pugixml minizip gflags stats_client icu
include($$ROOT_DIR/common.pri)
diff --git a/indexer/feature_utils.cpp b/indexer/feature_utils.cpp
index 6cc905e586..235811225a 100644
--- a/indexer/feature_utils.cpp
+++ b/indexer/feature_utils.cpp
@@ -37,22 +37,18 @@ bool GetTransliteratedName(feature::RegionData const & regionData, StringUtf8Mul
string srcName;
for (auto const code : mwmLangCodes)
- {
- if (src.GetString(code, srcName))
- {
- out = Transliteration::GetInstance().Transliterate(srcName, code);
- if (!out.empty())
- return true;
- }
- }
+ if (src.GetString(code, srcName) && Transliteration::Instance().Transliterate(srcName, code, out))
+ return true;
+
+ // If default name is available, interpret it as a name for the first mwm language.
if (!mwmLangCodes.empty() && src.GetString(StringUtf8Multilang::kDefaultCode, srcName))
- out = Transliteration::GetInstance().Transliterate(srcName, mwmLangCodes[0]);
- return !out.empty();
+ return Transliteration::Instance().Transliterate(srcName, mwmLangCodes[0], out);
+
+ return false;
}
bool GetBestName(StringUtf8Multilang const & src, vector<int8_t> const & priorityList, string & out)
{
- out.clear();
auto bestIndex = priorityList.size();
auto const findAndSet = [](vector<int8_t> const & langs, int8_t const code, string const & name,
@@ -72,7 +68,6 @@ bool GetBestName(StringUtf8Multilang const & src, vector<int8_t> const & priorit
return false;
findAndSet(priorityList, code, name, bestIndex, out);
-
return true;
});
@@ -83,7 +78,7 @@ bool GetBestName(StringUtf8Multilang const & src, vector<int8_t> const & priorit
out = out.substr(0, out.find_first_of(','));
}
- return !out.empty();
+ return bestIndex < priorityList.size();
}
} // namespace
@@ -236,11 +231,12 @@ void GetPreferredNames(RegionData const & regionData, StringUtf8Multilang const
if (src.IsEmpty())
return;
- if (!GetBestName(src, {deviceLang, StrUtf8::kInternationalCode, StrUtf8::kEnglishCode}, primary) &&
- allowTranslit)
- {
+ vector<int8_t> const primaryCodes = {deviceLang,
+ StrUtf8::kInternationalCode,
+ StrUtf8::kEnglishCode};
+
+ if (!GetBestName(src, primaryCodes, primary) && allowTranslit)
GetTransliteratedName(regionData, src, primary);
- }
vector<int8_t> secondaryCodes = {StrUtf8::kDefaultCode,
StrUtf8::kInternationalCode};
@@ -276,7 +272,7 @@ void GetReadableName(RegionData const & regionData, StringUtf8Multilang const &
codes = {deviceLang, StrUtf8::kInternationalCode, StrUtf8::kEnglishCode};
if (GetBestName(src, codes, out))
- return;
+ return;
if (allowTranslit && GetTransliteratedName(regionData, src, out))
return;
@@ -290,5 +286,4 @@ void GetReadableName(RegionData const & regionData, StringUtf8Multilang const &
GetMwmLangName(regionData, src, out);
}
-
} // namespace feature
diff --git a/indexer/feature_utils.hpp b/indexer/feature_utils.hpp
index f627e284ec..7f4f055147 100644
--- a/indexer/feature_utils.hpp
+++ b/indexer/feature_utils.hpp
@@ -18,8 +18,8 @@ namespace feature
/// Primary name using priority:
/// - device language name;
/// - international name;
- /// - english name.
- /// - transliterated name.
+ /// - english name;
+ /// - transliterated name (if allowed).
/// Secondary name using priority:
/// - default name;
/// - international name;
@@ -35,13 +35,13 @@ namespace feature
/// - default name;
/// - international name;
/// - english name;
- /// - transliterated name;
+ /// - transliterated name (if allowed);
/// - country language name.
/// When MWM does not contain user's language, the priority is the following:
/// - device language name;
/// - international name;
/// - english name;
- /// - transliterated name;
+ /// - transliterated name (if allowed);
/// - default name;
/// - country language name.
void GetReadableName(RegionData const & regionData, StringUtf8Multilang const & src,
diff --git a/map/framework.cpp b/map/framework.cpp
index e9f67426d8..b4ab9227dc 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -131,7 +131,9 @@ char const kTrafficEnabledKey[] = "TrafficEnabled";
char const kTrafficSimplifiedColorsKey[] = "TrafficSimplifiedColors";
char const kLargeFontsSize[] = "LargeFontsSize";
+#if defined(OMIM_OS_ANDROID)
char const kICUDataFile[] = "icudt57l.dat";
+#endif
double const kDistEqualQueryMeters = 100.0;
double const kLargeFontsScaleFactor = 1.6;
@@ -195,7 +197,7 @@ string MakeSearchBookingUrl(Index const & index, booking::Api const & bookingApi
{
search::ReverseGeocoder const coder(index);
string hotelName;
- ft.GetReadableName(hotelName);
+ ft.GetReadableName(false /* allowTranslit */, hotelName);
auto const lang = StringUtf8Multilang::GetLangIndex(languages::GetCurrentNorm());
string city = cityFinder.GetCityName(ft.GetCenter(), lang);
@@ -498,16 +500,8 @@ Framework::Framework()
m_cityFinder = make_unique<CityFinder>(m_model.GetIndex());
-#ifdef OMIM_OS_ANDROID
- ZipFileReader::UnzipFile(GetPlatform().ResourcesDir(),
- std::string("assets/") + kICUDataFile,
- GetPlatform().WritableDir() + kICUDataFile);
-
- Transliteration::GetInstance().Init(GetPlatform().WritableDir());
-#else
- Transliteration::GetInstance().Init(GetPlatform().ResourcesDir());
-#endif
-
+ InitTransliteration();
+ LOG(LDEBUG, ("Transliterators initialized"));
}
Framework::~Framework()
@@ -1432,6 +1426,25 @@ void Framework::InitSearchEngine()
}
}
+void Framework::InitTransliteration()
+{
+#if defined(OMIM_OS_ANDROID)
+ try
+ {
+ ZipFileReader::UnzipFile(GetPlatform().ResourcesDir(),
+ std::string("assets/") + kICUDataFile,
+ GetPlatform().WritableDir() + kICUDataFile);
+ }
+ catch (Reader::OpenException const & e)
+ {
+ LOG(LWARNING, ("Can't get transliteration data file \"", kICUDataFile, "\", reason:", e.what()));
+ }
+ Transliteration::GetInstance().Init(GetPlatform().WritableDir());
+#else
+ Transliteration::Instance().Init(GetPlatform().ResourcesDir());
+#endif
+}
+
storage::TCountryId Framework::GetCountryIndex(m2::PointD const & pt) const
{
return m_infoGetter->GetRegionCountryId(pt);
@@ -2135,7 +2148,6 @@ void Framework::SetMapSelectionListeners(TActivateMapSelectionFn const & activat
void Framework::ActivateMapSelection(bool needAnimation, df::SelectionShape::ESelectedObject selectionType,
place_page::Info const & info)
{
-
ASSERT_NOT_EQUAL(selectionType, df::SelectionShape::OBJECT_EMPTY, ("Empty selections are impossible."));
m_selectedFeature = info.GetID();
CallDrapeFunction(bind(&df::DrapeEngine::SelectObject, _1, selectionType, info.GetMercator(), info.GetID(),
diff --git a/map/framework.hpp b/map/framework.hpp
index bda5373a16..26ba606fa3 100644
--- a/map/framework.hpp
+++ b/map/framework.hpp
@@ -195,6 +195,8 @@ protected:
void CallDrapeFunction(TDrapeFunction const & fn) const;
+ void InitTransliteration();
+
public:
Framework();
virtual ~Framework();
diff --git a/map/map_tests/CMakeLists.txt b/map/map_tests/CMakeLists.txt
index 5c0e47a99b..199d2a1e5e 100644
--- a/map/map_tests/CMakeLists.txt
+++ b/map/map_tests/CMakeLists.txt
@@ -15,6 +15,7 @@ set(
gps_track_test.cpp
kmz_unarchive_test.cpp
mwm_url_tests.cpp
+ transliteration_test.cpp
working_time_tests.cpp
)
diff --git a/map/map_tests/transliteration_test.cpp b/map/map_tests/transliteration_test.cpp
index 6ffbf9bc6e..87693a559f 100644
--- a/map/map_tests/transliteration_test.cpp
+++ b/map/map_tests/transliteration_test.cpp
@@ -5,32 +5,43 @@
#include "platform/platform.hpp"
+namespace
+{
+void TestTransliteration(Transliteration const & translit, std::string const & locale,
+ std::string const & original, std::string const & expected)
+{
+ std::string out;
+ translit.Transliterate(original, StringUtf8Multilang::GetLangIndex(locale), out);
+ TEST_EQUAL(expected, out, ());
+}
+} // namespace
+
// This test is inside of the map_tests because it uses Platform for obtaining the resource directory.
UNIT_TEST(Transliteration_CompareSamples)
{
- Transliteration & translit = Transliteration::GetInstance();
+ Transliteration & translit = Transliteration::Instance();
translit.Init(GetPlatform().ResourcesDir());
- TEST_EQUAL("ạlʿrbyẗ", translit.Transliterate("العربية", StringUtf8Multilang::GetLangIndex("ar")), ());
- TEST_EQUAL("Russkiy", translit.Transliterate("Русский", StringUtf8Multilang::GetLangIndex("ru")), ());
- TEST_EQUAL("zhōng wén", translit.Transliterate("中文", StringUtf8Multilang::GetLangIndex("zh")), ());
- TEST_EQUAL("Byelaruskaya", translit.Transliterate("Беларуская", StringUtf8Multilang::GetLangIndex("be")), ());
- TEST_EQUAL("kartuli", translit.Transliterate("ქართული", StringUtf8Multilang::GetLangIndex("ka")), ());
- TEST_EQUAL("hangug-eo", translit.Transliterate("한국어", StringUtf8Multilang::GetLangIndex("ko")), ());
- TEST_EQUAL("‘vryt", translit.Transliterate("עברית", StringUtf8Multilang::GetLangIndex("he")), ());
- TEST_EQUAL("Ellēniká", translit.Transliterate("Ελληνικά", StringUtf8Multilang::GetLangIndex("el")), ());
- TEST_EQUAL("pīn yīn", translit.Transliterate("拼音", StringUtf8Multilang::GetLangIndex("zh_pinyin")), ());
- TEST_EQUAL("thịy", translit.Transliterate("ไทย", StringUtf8Multilang::GetLangIndex("th")), ());
- TEST_EQUAL("Srpski", translit.Transliterate("Српски", StringUtf8Multilang::GetLangIndex("sr")), ());
- TEST_EQUAL("Ukrayinsʹka", translit.Transliterate("Українська", StringUtf8Multilang::GetLangIndex("uk")), ());
- TEST_EQUAL("fạrsy̰", translit.Transliterate("فارسی", StringUtf8Multilang::GetLangIndex("fa")), ());
- TEST_EQUAL("Hayerēn", translit.Transliterate("Հայերէն", StringUtf8Multilang::GetLangIndex("hy")), ());
- TEST_EQUAL("kannaḍa", translit.Transliterate("ಕನ್ನಡ", StringUtf8Multilang::GetLangIndex("kn")), ());
- TEST_EQUAL("āmarinya", translit.Transliterate("አማርኛ", StringUtf8Multilang::GetLangIndex("am")), ());
- TEST_EQUAL("katakana", translit.Transliterate("カタカナ", StringUtf8Multilang::GetLangIndex("ja_kana")), ());
- TEST_EQUAL("Bŭlgarski", translit.Transliterate("Български", StringUtf8Multilang::GetLangIndex("bg")), ());
- TEST_EQUAL("Qazaq", translit.Transliterate("Қазақ", StringUtf8Multilang::GetLangIndex("kk")), ());
- TEST_EQUAL("Mongol hel", translit.Transliterate("Монгол хэл", StringUtf8Multilang::GetLangIndex("mn")), ());
- TEST_EQUAL("Makedonski", translit.Transliterate("Македонски", StringUtf8Multilang::GetLangIndex("mk")), ());
- TEST_EQUAL("hindī", translit.Transliterate("हिन्दी", StringUtf8Multilang::GetLangIndex("hi")), ());
+ TestTransliteration(translit, "ar", "العربية", "ạlʿrbyẗ");
+ TestTransliteration(translit, "ru", "Русский", "Russkiy");
+ TestTransliteration(translit, "zh", "中文", "zhōng wén");
+ TestTransliteration(translit, "be", "Беларуская", "Byelaruskaya");
+ TestTransliteration(translit, "ka", "ქართული", "kartuli");
+ TestTransliteration(translit, "ko", "한국어", "hangug-eo");
+ TestTransliteration(translit, "he", "עברית", "‘vryt");
+ TestTransliteration(translit, "el", "Ελληνικά", "Ellēniká");
+ TestTransliteration(translit, "zh_pinyin", "拼音", "pīn yīn");
+ TestTransliteration(translit, "th", "ไทย", "thịy");
+ TestTransliteration(translit, "sr", "Српски", "Srpski");
+ TestTransliteration(translit, "uk", "Українська", "Ukrayinsʹka");
+ TestTransliteration(translit, "fa", "فارسی", "fạrsy̰");
+ TestTransliteration(translit, "hy", "Հայերէն", "Hayerēn");
+ TestTransliteration(translit, "kn", "ಕನ್ನಡ", "kannaḍa");
+ TestTransliteration(translit, "am", "አማርኛ", "āmarinya");
+ TestTransliteration(translit, "ja_kana", "カタカナ", "katakana");
+ TestTransliteration(translit, "bg", "Български", "Bŭlgarski");
+ TestTransliteration(translit, "kk", "Қазақ", "Qazaq");
+ TestTransliteration(translit, "mn", "Монгол хэл", "Mongol hel");
+ TestTransliteration(translit, "mk", "Македонски", "Makedonski");
+ TestTransliteration(translit, "hi", "हिन्दी", "hindī");
}
diff --git a/map/style_tests/CMakeLists.txt b/map/style_tests/CMakeLists.txt
index a6ee3465cd..e7a334023b 100644
--- a/map/style_tests/CMakeLists.txt
+++ b/map/style_tests/CMakeLists.txt
@@ -25,11 +25,11 @@ omim_link_libraries(
oauthcpp
platform
jansson
- icu
geometry
coding
base
protobuf
+ icu
stats_client
${LIBZ}
)
diff --git a/xcode/map/map.xcodeproj/project.pbxproj b/xcode/map/map.xcodeproj/project.pbxproj
index 00602eea2d..b9b7433df3 100644
--- a/xcode/map/map.xcodeproj/project.pbxproj
+++ b/xcode/map/map.xcodeproj/project.pbxproj
@@ -91,6 +91,7 @@
67F183811BD5049500AB1840 /* libagg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 67F1837D1BD5049500AB1840 /* libagg.a */; };
67F183831BD5049500AB1840 /* libminizip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 67F1837F1BD5049500AB1840 /* libminizip.a */; };
67F183841BD5049500AB1840 /* libtess2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 67F183801BD5049500AB1840 /* libtess2.a */; };
+ BB421D6C1E8C0031005BFA4D /* transliteration_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BB421D6A1E8C0026005BFA4D /* transliteration_test.cpp */; };
F63421F81DF9BF9100A96868 /* reachable_by_taxi_checker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F63421F61DF9BF9100A96868 /* reachable_by_taxi_checker.cpp */; };
F63421F91DF9BF9100A96868 /* reachable_by_taxi_checker.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F63421F71DF9BF9100A96868 /* reachable_by_taxi_checker.hpp */; };
F6B283031C1B03320081957A /* gps_track_collection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6B282FB1C1B03320081957A /* gps_track_collection.cpp */; };
@@ -210,6 +211,7 @@
67F183801BD5049500AB1840 /* libtess2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtess2.a; path = "../../../omim-xcode-build/Debug/libtess2.a"; sourceTree = "<group>"; };
67F183851BD504ED00AB1840 /* libsystem_configuration.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsystem_configuration.tbd; path = usr/lib/system/libsystem_configuration.tbd; sourceTree = SDKROOT; };
67F183871BD5050900AB1840 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
+ BB421D6A1E8C0026005BFA4D /* transliteration_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = transliteration_test.cpp; sourceTree = "<group>"; };
F63421F61DF9BF9100A96868 /* reachable_by_taxi_checker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = reachable_by_taxi_checker.cpp; sourceTree = "<group>"; };
F63421F71DF9BF9100A96868 /* reachable_by_taxi_checker.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reachable_by_taxi_checker.hpp; sourceTree = "<group>"; };
F6B282FB1C1B03320081957A /* gps_track_collection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gps_track_collection.cpp; sourceTree = "<group>"; };
@@ -295,6 +297,7 @@
674A29CA1B26FCC0001A525C /* map_tests */ = {
isa = PBXGroup;
children = (
+ BB421D6A1E8C0026005BFA4D /* transliteration_test.cpp */,
679624A01D1017C200AE4E3C /* address_tests.cpp */,
679624A11D1017C200AE4E3C /* feature_getters_tests.cpp */,
679624A21D1017C200AE4E3C /* gps_track_collection_test.cpp */,
@@ -552,6 +555,7 @@
buildActionMask = 2147483647;
files = (
67F183761BD5045700AB1840 /* bookmarks_test.cpp in Sources */,
+ BB421D6C1E8C0031005BFA4D /* transliteration_test.cpp in Sources */,
67F183771BD5045700AB1840 /* ge0_parser_tests.cpp in Sources */,
679624B21D1017DB00AE4E3C /* mwm_set_test.cpp in Sources */,
67F183781BD5045700AB1840 /* geourl_test.cpp in Sources */,