/hs-char-mapper

Simple Char Mapping utilitity in haskell

Primary LanguageHaskellBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Click here to view my repository's master branch

Mapper between UTF-8 compliant characters

Summary

  • Given a string, convert each character to another character as specified in mappings.csv.

Installation

  1. Use git clone to clone the repository to your local machine
  2. CD into the folder, run stack init and stack install. This will install an executable somewhere in your machine depending on your Operating System.

Usage

  1. Create a new folder on your Desktop and place the executable in the folder.
  2. In that newly created folder, create a file called mappings.csv. mappings.csv must conform to the format below:
  • Each line must contain only 2 records. They two records must be separated by a comma.
  • Each record on each line must be a single character.
  • Each Character must be UTF-8 compliant.
  • The first record is the character to convert from, while the second record is the character to convert to.
  1. See sample_mappings.csv as an example

Example (CLI application)

  • Suppose we are using the mappings in the sample_mappings.csv file.
  • When we run the executatable, we will be prompted to enter a line which we want to get translated.
  • Each of the character in the line will then be translated by referencing the mappings.csv file.
  • The image below shows the result in the Windows cmd terminal.

image

Legend: User input it is cold today is translated to ᛁ ᛏᛁ ᛋᚳᚩᛚ ᛞᛏᚩᛞᚪ by referencing the file mappings.csv

Example (GUI Application)

  • Coming soon