Closed bertfrees closed 9 years ago
With pre-translation, I think you are right. There would have to be some addition to the API to support it. Not sure if that is needed though. We should discuss it.
OK, I think if it would already be possible we should support it. But otherwise I'm not sure we should go there unless you are planning to do pre-translation in some situations.
I have added a new translator interface to dotify.api:1.3.0 called BrailleFilter. It is a simpler version of BrailleTranslator in that it does not support non-standard hyphenation and e.g. number continuation. Instead, you get all hyphenation points in the result (which is a string).
Like the BrailleTranslator, the BrailleFilter has a factory and a factor service (and an SPI counterpart).
Dotify does not use these factories directly (for obvious reasons), but implementations of BrailleFilter can easily be adapted into BrailleTranslators, so it's no big deal to support the BrailleTranslator interface if you have a BrailleFilter.
dotify.translator.impl:1.2.0 has a BrailleFilter implementation for Swedish.
@joeha480 Your new API seems to work for me. The DotifyTranslatorImpl
class now supports pre-translation with hyphenation.
@joeha480 Is this even possible because there is no way to get all possible break positions from a
BrailleTranslatorResult
?