Compare commits
No commits in common. "7e9e632b153a69bd6163e1fbf8634307fd4a367d" and "f63901f0cc895078e6abdfb465c8e52f9db967cc" have entirely different histories.
7e9e632b15
...
f63901f0cc
15 changed files with 34 additions and 144 deletions
16
.appveyor.yml
Normal file
16
.appveyor.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
version: '{branch}-{build}'
|
||||
|
||||
platform: x64
|
||||
|
||||
environment:
|
||||
CYG_ROOT: C:\cygwin64
|
||||
CYG_SHELL: C:\cygwin64\bin\sh
|
||||
|
||||
install:
|
||||
- cmd: '%CYG_ROOT%\setup-x86_64.exe --quiet-mode --no-shortcuts --upgrade-also --packages autoconf,make,git,gcc,check'
|
||||
|
||||
build_script:
|
||||
- cmd: '%CYG_SHELL% -lc "cd $APPVEYOR_BUILD_FOLDER && sh autogen.sh && sh configure && make all"'
|
||||
|
||||
test_script:
|
||||
- cmd: '%CYG_SHELL% -lc "cd $APPVEYOR_BUILD_FOLDER && make test"'
|
22
.github/workflows/test.yml
vendored
22
.github/workflows/test.yml
vendored
|
@ -1,22 +0,0 @@
|
|||
name: C/C++ CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: dependencies
|
||||
run: sudo apt update && sudo apt install -y autoconf make gcc lcov check pkg-config
|
||||
- name: configure
|
||||
run: sh autogen.sh && ./configure
|
||||
- name: make
|
||||
run: make
|
||||
- name: maketest
|
||||
run: make test
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,7 +3,6 @@
|
|||
*.d
|
||||
*.so
|
||||
*.so.*
|
||||
*.pc
|
||||
/iast
|
||||
/tests/test
|
||||
/tests/coverage
|
||||
|
|
25
Makefile.in
25
Makefile.in
|
@ -19,14 +19,13 @@ INSTALL_DATA = @INSTALL_DATA@
|
|||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
bindir = @bindir@
|
||||
libdir = @libdir@
|
||||
datarootdir = @datarootdir@
|
||||
includedir = @includedir@
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
mandir = @mandir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
bindir = @bindir@
|
||||
libdir = @libdir@
|
||||
datarootdir = @datarootdir@
|
||||
includedir = @includedir@
|
||||
mandir = @mandir@
|
||||
|
||||
USE_GCOV = @USE_GCOV@
|
||||
|
||||
|
@ -58,7 +57,7 @@ $(ANAME): $(OBJECTS)
|
|||
$(QUIET_AR) $(AR) rcs $@ $^
|
||||
|
||||
$(REALNAME): $(OBJECTS)
|
||||
$(QUIET_LD) $(CC) $^ -shared -Wl,-soname=$(SONAME) -o $@ $(LFLAGS)
|
||||
$(QUIET_LD) $(CC) $^ -shared -o $@ $(LFLAGS)
|
||||
|
||||
$(SONAME): $(REALNAME)
|
||||
$(QUIET_LN) $(LN_S) -f $< $@
|
||||
|
@ -84,7 +83,7 @@ tests/test: $(OBJECTS) $(TEST_OBJECTS)
|
|||
install: install-prog install-lib install-dev
|
||||
|
||||
install-prog:
|
||||
$(MKDIR_P) $(bindir) $(mandir)/man1
|
||||
$(MKDIR_P) $(bindir) $(libdir) $(mandir)/man1
|
||||
$(INSTALL_PROGRAM) $(PROGNAME) $(bindir)
|
||||
$(INSTALL_DATA) $(PROGNAME).1.gz $(mandir)/man1
|
||||
|
||||
|
@ -93,10 +92,9 @@ install-lib:
|
|||
cp -P $(REALNAME) $(SONAME) $(libdir)
|
||||
|
||||
install-dev:
|
||||
$(MKDIR_P) $(includedir)/iast $(libdir) $(pkgconfigdir)
|
||||
$(MKDIR_P) $(includedir)/iast $(libdir)
|
||||
$(INSTALL_DATA) $(INCLUDES) $(includedir)/iast
|
||||
$(INSTALL_DATA) iast.h $(includedir)
|
||||
$(INSTALL_DATA) $(PROGNAME).pc $(pkgconfigdir)
|
||||
cp -P $(ANAME) $(LINKNAME) $(libdir)
|
||||
|
||||
uninstall: uninstall-prog uninstall-lib uninstall-dev
|
||||
|
@ -110,11 +108,10 @@ uninstall-lib:
|
|||
|
||||
uninstall-dev:
|
||||
$(RM) -r $(includedir)/iast $(includedir)/iast.h
|
||||
$(RM) $(pkgconfigdir)/$(PROGNAME).pc
|
||||
|
||||
clean:
|
||||
$(RM) $(PROGNAME) tests/test $(PROGNAME).1.gz
|
||||
$(RM) -r $(LIBFILES) *.o */*.o */*.d *.d $(PROGNAME).pc
|
||||
$(RM) -r $(LIBFILES) *.o */*.o */*.d *.d
|
||||
$(RM) *.gcda *.gcno tests/coverage */*.test
|
||||
|
||||
clean-aux:
|
||||
|
|
6
README
6
README
|
@ -16,12 +16,6 @@ For more details on the usage of the program and the requirements for the input
|
|||
data, see the included manual page iast(1).
|
||||
|
||||
|
||||
Donations
|
||||
---------
|
||||
If you like this project and it is useful to you, consider sending a donation
|
||||
to the following Bitcoin address: 1LXAkkvKodKB237yayzCTYAsb8tYawGfHz
|
||||
|
||||
|
||||
Licensing Notice
|
||||
----------------
|
||||
This software is released under the terms of the GPL license version 2 as
|
||||
|
|
1
compat.h
1
compat.h
|
@ -8,7 +8,6 @@
|
|||
#include <fcntl.h>
|
||||
#include <stdarg.h>
|
||||
#include <getopt.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define ARRAY_SIZE(a) sizeof(a) / sizeof(*a)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
AC_INIT([sanskrit-iast], [3.1.0], [vlastavesely@protonmail.ch])
|
||||
AC_INIT([sanskrit-iast], [3.0.0], [vlastavesely@protonmail.ch])
|
||||
AC_CONFIG_SRCDIR([transliteration.c])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
|
@ -17,9 +17,6 @@ AC_PROG_INSTALL
|
|||
AC_PROG_LN_S
|
||||
AC_CHECK_TOOL([AR], [ar])
|
||||
|
||||
PKG_PROG_PKG_CONFIG
|
||||
PKG_INSTALLDIR
|
||||
|
||||
# Checks for libraries.
|
||||
PKG_CHECK_MODULES(CHECK, check)
|
||||
|
||||
|
@ -59,5 +56,5 @@ AC_SUBST(COVERAGE_CFLAGS)
|
|||
AC_SUBST(COVERAGE_LFLAGS)
|
||||
AC_SUBST(USE_GCOV)
|
||||
|
||||
AC_CONFIG_FILES([Makefile iast.pc])
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
|
|
|
@ -3,14 +3,6 @@
|
|||
#ifndef __HARVARD_KYOTO_H
|
||||
#define __HARVARD_KYOTO_H
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int encode_harvard_kyoto_to_iast(const char *text, char **out);
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __HARVARD_KYOTO_H */
|
||||
|
|
22
iast.1
22
iast.1
|
@ -1,4 +1,4 @@
|
|||
.TH "iast" "1" "02 March 2023" "sanskrit-iast" "Sanskrit Transliteration"
|
||||
.TH "iast" "1" "10 January 2022" "sanskrit-iast" "Sanskrit Transliteration"
|
||||
|
||||
.SH NAME
|
||||
.B iast
|
||||
|
@ -98,19 +98,6 @@ representation using the
|
|||
scheme.
|
||||
.RE
|
||||
|
||||
.BR \-k ,
|
||||
.BR \-\-harvard ,
|
||||
.BR \-\-kyoto
|
||||
.RS 4
|
||||
Convert a plain
|
||||
.BR ASCII (7)
|
||||
string to the
|
||||
.I IAST
|
||||
representation using the
|
||||
.I Harvard-Kyoto
|
||||
scheme.
|
||||
.RE
|
||||
|
||||
.BR \-a ,
|
||||
.B \-\-ascii
|
||||
.RS 4
|
||||
|
@ -214,17 +201,14 @@ Wikipedia:
|
|||
.br
|
||||
.I https://en.wikipedia.org/wiki/Velthuis
|
||||
- the Velthuis scheme.
|
||||
.br
|
||||
.I https://en.wikipedia.org/wiki/Harvard-Kyoto
|
||||
- the Harvard-Kyoto scheme.
|
||||
.RE
|
||||
|
||||
|
||||
.SH REPORTING BUGS
|
||||
If you encounter a bug, you should make sure that you are using the latest
|
||||
version of the software. If you are and the bug is still present, you can
|
||||
report it on the GitHub issues tracker:
|
||||
.IR https://github.com/vlastavesely/sanskrit-iast/issues .
|
||||
report it on the GitLab issues tracker:
|
||||
.IR https://gitlab.com/vlastavesely/sanskrit-iast/issues .
|
||||
|
||||
|
||||
.SH LICENSE AND WARRANTY
|
||||
|
|
11
iast.pc.in
11
iast.pc.in
|
@ -1,11 +0,0 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: libiast
|
||||
URL: https://github.com/vlastavesely/sanskrit-iast
|
||||
Description: Library for romanisation of texts written in Devanagari
|
||||
Version: @PACKAGE_VERSION@
|
||||
Libs: -L${libdir} -liast
|
||||
Cflags:
|
|
@ -152,7 +152,7 @@ END_TEST
|
|||
|
||||
START_TEST(test_version)
|
||||
{
|
||||
test_output("./iast -v", "iast v3.1.0\n");
|
||||
test_output("./iast -v", "iast v3.0.0\n");
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
|
|
@ -23,18 +23,6 @@ static void test_translit(const char *devanagari, const char *latin)
|
|||
free(b);
|
||||
}
|
||||
|
||||
static void test_translit_latin(const char *latin, const char *devanagari)
|
||||
{
|
||||
char *str;
|
||||
int ret;
|
||||
|
||||
ret = transliterate_latin_to_devanagari(latin, &str);
|
||||
ck_assert_int_eq(0, ret);
|
||||
ck_assert_str_eq(devanagari, str);
|
||||
|
||||
free(str);
|
||||
}
|
||||
|
||||
START_TEST(test_translit_words)
|
||||
{
|
||||
/* https://en.wikipedia.org/wiki/Sanskrit */
|
||||
|
@ -64,9 +52,6 @@ START_TEST(test_translit_vedic)
|
|||
|
||||
/* vedic stresses */
|
||||
test_translit("अ॒ग्निमी॑ळे पु॒रोहि॑तं", "a\\_gnimī\\'ḷe pu\\_rohi\\'taṃ");
|
||||
|
||||
/* double svarita */
|
||||
test_translit("अ॒ग्निमी᳚ळे", "a\\_gnimī\\\"ḷe");
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
@ -82,17 +67,6 @@ START_TEST(test_translit_lla_sylable)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_translit_aum)
|
||||
{
|
||||
test_translit("ॐ औम औमे तौमे ॐ", "aum auma aume taume aum");
|
||||
}
|
||||
|
||||
START_TEST(test_translit_avagraha)
|
||||
{
|
||||
test_translit_latin("śivo'ham", "शिवोऽहम्");
|
||||
test_translit_latin("śivo’ham", "शिवोऽहम्");
|
||||
}
|
||||
|
||||
START_TEST(test_translit_candrabindu)
|
||||
{
|
||||
test_translit("तान्यजत्राँ", "tānyajatrām̐");
|
||||
|
@ -110,8 +84,6 @@ void register_translit_tests(TCase *test_case)
|
|||
tcase_add_test(test_case, test_translit_words);
|
||||
tcase_add_test(test_case, test_translit_vedic);
|
||||
tcase_add_test(test_case, test_translit_lla_sylable);
|
||||
tcase_add_test(test_case, test_translit_aum);
|
||||
tcase_add_test(test_case, test_translit_avagraha);
|
||||
tcase_add_test(test_case, test_translit_candrabindu);
|
||||
tcase_add_test(test_case, test_translit_zero_width_joiner);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#define SCHWA_CHARACTER 'a'
|
||||
#define ZERO_WIDTH_JOINER 0x200d
|
||||
#define VIRAMA 0x094d
|
||||
#define AUM 0x0950
|
||||
#define CHUNKSIZE 1024
|
||||
|
||||
static struct translit_letter table[] = {
|
||||
|
@ -36,7 +35,6 @@ static struct translit_letter table[] = {
|
|||
{0x0902, CODA, "\u1e43"}, /* anusvara (.m) */
|
||||
{0x0903, CODA, "\u1e25"}, /* visarga (.h) */
|
||||
{0x093d, CODA, "'"}, /* avagrada (') */
|
||||
{0x093d, CODA, "’"}, /* avagrada (’) - typographic */
|
||||
{0x0901, CODA, "m\u0310"}, /* candrabindu */
|
||||
|
||||
/* Consonants */
|
||||
|
@ -107,7 +105,6 @@ static struct translit_letter table[] = {
|
|||
{0x0964, CODA, "|"}, /* danda */
|
||||
|
||||
{0x0951, CODA, "\\'"}, /* svarita */
|
||||
{0x1cda, CODA, "\\\""}, /* double svarita */
|
||||
{0x0952, CODA, "\\_"} /* anudatta */
|
||||
};
|
||||
|
||||
|
@ -262,14 +259,6 @@ int transliterate_latin_to_devanagari(const char *latin, char **ret)
|
|||
letter = letter_by_code(0x0933); /* .la */
|
||||
}
|
||||
}
|
||||
|
||||
if (letter->code == AUM) {
|
||||
/* ‘aum’ is followed by something else than
|
||||
* a whitespace → it is ‘au’ + ‘m…’ */
|
||||
if (!isspace(src[3]) && src[3] != '\0') {
|
||||
letter = letter_by_code(0x0914);
|
||||
}
|
||||
}
|
||||
encode_consonant:
|
||||
/* A consonant or an initial vowel */
|
||||
utf8_pack_char(devanagari + done, letter->code);
|
||||
|
|
|
@ -3,10 +3,6 @@
|
|||
#ifndef __TRANSLITERATION_H
|
||||
#define __TRANSLITERATION_H
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum translit_letter_type {
|
||||
VOWEL,
|
||||
CONSONANT,
|
||||
|
@ -34,8 +30,4 @@ static inline int is_devanagari(unsigned int code)
|
|||
return code >= 0x0900 && code <= 0x097f;
|
||||
}
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __TRANSLITERATION_H */
|
||||
|
|
|
@ -3,15 +3,7 @@
|
|||
#ifndef __VELTHUIS_H
|
||||
#define __VELTHUIS_H
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int encode_velthuis_to_iast(const char *text, char **out);
|
||||
int encode_iast_to_velthuis(const char *text, char **out);
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __VELTHUIS_H */
|
||||
|
|
Loading…
Add table
Reference in a new issue