Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pali-hyphenator,js #70

Closed
sujato opened this issue Aug 3, 2020 · 0 comments
Closed

Implement pali-hyphenator,js #70

sujato opened this issue Aug 3, 2020 · 0 comments
Assignees

Comments

@sujato
Copy link
Contributor

sujato commented Aug 3, 2020

A long-standing problem with Pali and Sanskrit is that certain words are very long, making it difficult to produce decent layout on the web.

Ideally this would work via browser hyphenation, but there is no support for Pali or Sanskrit. I have proposed a solution using fallbacks in CSS but this will take time, if it is ever implemented.

In the past, SC added soft-hyphens to the Pali text, but it ended up creating a bunch of problems with search, reusing texts, etc.

Karl based on Vimala's work has now implemented a js-based hyphenation for Pali.

https://github.com/sc-voice/js-ebt/tree/master/src

  • Can be applied client-side or server-side.
  • Minimum word length can be set.

Let us implement this on SC.

Soft-hyphens must be inserted as late as practical. We found that they tend to create issues, sometimes unpredictably, so they should not be in the text that is used for search, or anything else. The problem they are solving is purely about presentation in a specific context, so they should only apply in that context, i.e. when the text is rendered in the browser. Thus I think it will be best to apply them client-side. To avoid slowing the page, do it lazily.

As for minimum word length, Karl uses it at 20 characters for voice. Let's try that for starters.

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

No branches or pull requests

2 participants