Quantcast
Channel: Active questions tagged mapping - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 50

How mapping works in transliteration?

$
0
0

My curiosity lies on mapping for transliteration. I am working on a project that uses transliteration. I have seen some solved code for this. But I could understand them. For example,

\def\tcmapto#1#2{\expandafter\def\csname tcmapto\number`#1\endcsname{#2}}\def\tcmapnumto#1#2{\expandafter\def\csname tcmapto#1\endcsname{#2}}\def\tcremap#1{\ifcsname tcmapto\number`#1\endcsname                 \csname tcmapto\number`#1\endcsname\else#1\fi}

Question: How these three lines work part by part. Can anyone elaborate with patience. Thank you.

Complete code:

\documentclass{article}\usepackage{tokcycle}\def\tcmapto#1#2{\expandafter\def\csname tcmapto\number`#1\endcsname{#2}}\def\tcmapnumto#1#2{\expandafter\def\csname tcmapto#1\endcsname{#2}}\def\tcremap#1{\ifcsname tcmapto\number`#1\endcsname                 \csname tcmapto\number`#1\endcsname\else#1\fi}\tcmapto{ং}{n}% OR \tcmapnumto{2434}{n}\tcmapto{আ}{Ā}% OR \tcmapnumto{2438}{Ā}\tcmapto{ন}{n}% OR \tcmapnumto{2472}{n}\tcmapto{ব}{b}% OR \tcmapnumto{2476}{b}\tcmapto{ম}{m}% OR \tcmapnumto{2478}{m}\tcmapto{র}{ra}% OR \tcmapnumto{2480}{ra}\tcmapto{ল}{l}% OR \tcmapnumto{2482}{l}\tcmapto{স}{s}% OR \tcmapnumto{2488}{s}\tcmapto{া}{ā}% OR \tcmapnumto{2494}{ā}\tcmapto{ো}{ō}% OR \tcmapnumto{2507}{ō}\begin{document}\Characterdirective{\addcytoks[x]{\tcremap{#1}}}\tokencyclexpressআমারসোনারবাংলাআ-মা-রসো-না-রবাং-লা\endtokencyclexpress\end{document}

Viewing all articles
Browse latest Browse all 50

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>