This AWS Lambda function takes a word as input and returns its phoneme representation using the CMU Sphinx's phonetic dictionary. If the input word is found in the dictionary, the function returns its phonemes; otherwise, it indicates that the word is unknown.
- AWS CLI configured with appropriate permissions.
- Rust installed on your system.
- cargo-lambda for building and deploying Lambda functions in Rust.
- Input: A JSON object with a single key
word
, where the value is the word you want to convert to phonemes. - Output: A JSON object containing:
req_id
: The request ID for the invocation.phonemes
: The phonetic representation of the input word if found in the dictionary.message
: Indicates "Data processed" if the word was found, or "unknown word" otherwise.
- Install cargo-lambda
- Build the function with
cargo lambda build --release
- Deploy the function to AWS Lambda with
cargo lambda deploy --iam-role YOUR_ROLE
Build the function with cargo lambda build --release --arm64