Date format for use with text to speech in Java

I have Dateone that I would like to format into text, which can be used using a text-to-speech mechanism. I am currently doing this manually using various SimpleDateFormats.

Examples of what should be the result of formatting:

  • January 25, two thousand at 18:00.
  • January 25, two thousand at 7 pm 5 pm
  • January 25, two thousand and eleven at 7 52 pm.

Any thoughts? Thank.

+3
source share
3 answers

, , " " " ", , , , , , //else, .

http://sourceforge.net/projects/fuzzytime/ Python script, , " ", .

, , , .

+1

. , , . , TTS. JAVA: Word

0

Given the limited time and / or budget, I would probably use it SimpleDateFormatto create elements separated by delimiters, and then write my own function to convert this text into human-readable text.

So, I first convert to:
January|25|2001|6|00|PM
January|25|2000|7|05|PM
January|25|2011|7|52|PM

then parse the result into a custom format (depending on how I want to hear the audio date / time), then execute the text into speech. The number of edge cases seems to me low.

0
source

Source: https://habr.com/ru/post/1788261/


All Articles