Skip to content

Conversation

@mufeedvh
Copy link
Member

Summary

  • Adds Ruby support for symbol removal functionality
  • Implements removal methods for all symbol types with accept conditions
  • Provides examples and test cases

Changes

  • Added FFI binding for vm_remove_tokens in varnamruby.rb
  • Added _remove_token base method and specific removal methods in compile-scheme.rb:
    • remove_vowels
    • remove_consonants
    • remove_consonant_vowel_combinations
    • remove_anusvara
    • remove_visarga
    • remove_virama
    • remove_symbols
    • remove_numbers
    • remove_others
  • Added test examples in test/removal.rb
  • Added Malayalam scheme example demonstrating the feature

Usage

# Remove 'മ്' at the end of words for pattern 'm'
remove_anusvara({:accept_if => :ends_with}, "m" => ["മ്"])

# Remove specific consonants at start
remove_consonants({:accept_if => :starts_with}, "ka" => ["ക"])

# Remove vowel signs in between words
remove_vowels({:accept_if => :in_between}, "a" => ["ാ"])

Dependencies

Test plan

  • Ruby syntax validation tests added
  • Example scheme created
  • Integration testing with actual VST compilation

Related to varnamproject/govarnam#23

- Add FFI binding for vm_remove_tokens function
- Add _remove_token base method for internal use
- Add removal methods for all symbol types:
  - remove_vowels
  - remove_consonants
  - remove_consonant_vowel_combinations
  - remove_anusvara
  - remove_visarga
  - remove_virama
  - remove_symbols
  - remove_numbers
  - remove_others
- Add test examples and Malayalam scheme example
- Complements varnamproject/govarnam#68

This enables scheme authors to remove specific symbols based on
their position (starts_with, ends_with, in_between), providing
fine-grained control over transliteration rules.

Example usage:
remove_anusvara({:accept_if => :ends_with}, "m" => ["മ്"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant