SingingPub

Saturday, 7 October 2023

[New post] More Adjustments to Reciter

Site logo image synsinger posted: " There was one last bit of work that needed to be done to the Reciter class, transforming the letters-to-phoneme string back into just phonemes and placing the hyphens in the right place. Given the input string: "sup-er-nat-ur-al" The input strin" synSinger

More Adjustments to Reciter

synsinger

Oct 7

There was one last bit of work that needed to be done to the Reciter class, transforming the letters-to-phoneme string back into just phonemes and placing the hyphens in the right place.

Given the input string:

"sup-er-nat-ur-al"

The input string is cleaned of all non-alphabetic characters except for hyphens and apostrophes:

"SUP-ER-NAT-UR-AL"

The string is then prepared to be parsed by removing the hyphens and placing spaces as delimiters before and after the word:

" SUPERNATURAL "

This string is then processed by the Reciter rules to be solved, and it returns a string containing the original letters (in upper case) and the phonemes (in lower case):

"  Ss Uuw Pp Eer R Nn Aae Tch Uer R Aah Ll"

The parsed string is walked through character by character, basically:

var out_string:String = "" var clean_string_pos:int = 0 for letter in parsed_string:     if letter == " ":         if clean_string.substr(clean_string_pos,1) == "-"             out_string += "-"         clean_string_pos += 1     elif letter == letter.to_upper()         if letter != clean_string.substr(clean_string_pos,1):             # warning, letters should match             clean_string_pos += 1     else:         out_string += letter

The result is the phonetic string with hyphen placed as the user indicated:

suwp-er-naech-er-ahl

There's more that needs to be handled, the bare bones code is working.

Comment
Like
Tip icon image You can also reply to this email to leave a comment.

Unsubscribe to no longer receive posts from synSinger.
Change your email settings at manage subscriptions.

Trouble clicking? Copy and paste this URL into your browser:
https://synsinger.wordpress.com/2023/10/07/more-adjustments-to-reciter/

WordPress.com and Jetpack Logos

Get the Jetpack app to use Reader anywhere, anytime

Follow your favorite sites, save posts to read later, and get real-time notifications for likes and comments.

Download Jetpack on Google Play Download Jetpack from the App Store
WordPress.com on Twitter WordPress.com on Facebook WordPress.com on Instagram WordPress.com on YouTube
WordPress.com Logo and Wordmark title=

Automattic, Inc. - 60 29th St. #343, San Francisco, CA 94110  

at October 07, 2023
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

The Lesson Sammy Never Forgot: An Inspirational Story

Fresh Manna with Pastor Tim Burt    A Note from Tim Tim here. I'm so glad you're part o...

  • [New post] eRead of the Month: HERE FOR IT: Or, How to Save Your Soul in America
    Neil McKay posted: " This year's final eRead of the Month is HERE FOR IT: Or, How to Save Your Soul in America by R. Er...
  • The Rainbow Girls Connection
    Today marks the return of live music sags to Wise Madness; for many, this is wha...
  • [New post] Ceremony to mark Nakba
    ...

Search This Blog

  • Home

About Me

SingingPub
View my complete profile

Report Abuse

Blog Archive

  • July 2025 (23)
  • June 2025 (32)
  • May 2025 (16)
  • April 2025 (18)
  • March 2025 (21)
  • February 2025 (22)
  • January 2025 (16)
  • December 2024 (22)
  • November 2024 (8)
  • October 2024 (11)
  • September 2024 (11)
  • August 2024 (2722)
  • July 2024 (3200)
  • June 2024 (3080)
  • May 2024 (3199)
  • April 2024 (3101)
  • March 2024 (3214)
  • February 2024 (3014)
  • January 2024 (3244)
  • December 2023 (3192)
  • November 2023 (2685)
  • October 2023 (2042)
  • September 2023 (1758)
  • August 2023 (1539)
  • July 2023 (1533)
  • June 2023 (1380)
  • May 2023 (1397)
  • April 2023 (1335)
  • March 2023 (1392)
  • February 2023 (1320)
  • January 2023 (1600)
  • December 2022 (1555)
  • November 2022 (1389)
  • October 2022 (1230)
  • September 2022 (1023)
  • August 2022 (1109)
  • July 2022 (1122)
  • June 2022 (1141)
  • May 2022 (1120)
  • April 2022 (1178)
  • March 2022 (1085)
  • February 2022 (763)
  • January 2022 (924)
  • December 2021 (1347)
  • November 2021 (2424)
Powered by Blogger.