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

What is AlignmentEntry? #340

Closed
zyh3826 opened this issue May 5, 2023 · 3 comments
Closed

What is AlignmentEntry? #340

zyh3826 opened this issue May 5, 2023 · 3 comments

Comments

@zyh3826
Copy link

zyh3826 commented May 5, 2023

Hi, thanks for your work, it's really nice.
I use the code below to run an alignment:

with wave.open(args.audio, "rb") as audio:
    data = audio.getfp().read()
    decoder = Decoder(samprate=audio.getframerate())
    decoder.set_align_text(args.text)
    decoder.start_utt()
    decoder.process_raw(data, full_utt=True)
    decoder.end_utt()
    decoder.set_alignment()
    decoder.start_utt()
    decoder.process_raw(data, full_utt=True)
    decoder.end_utt()
    for word in decoder.get_alignment():
        print(list(word))

the result is an AlignmentEntry object, how can I find documents of this object? What are its attributions? Can't find it in your documents.
image

thanks a lot.

@zyh3826
Copy link
Author

zyh3826 commented May 5, 2023

I also try this, get the same results:

for word in decoder.get_alignment():
        for phone in word:
            for state in phone:
                print(word, phone, state)

image

@dhdaines
Copy link
Contributor

Hi! Sorry for the long time to reply, I am just catching up on PocketSphinx-related stuff now.

As it turns out the AlignmentEntry should be documented, but was accidentally left out of the online documentation - I will fix this in the next release, shortly. You can see its documentation by running python -m pydoc pocketsphinx._pocketsphinx.AlignmentEntry

See also its docstring here: https://github.com/cmusphinx/pocketsphinx/blob/master/cython/_pocketsphinx.pyx#L1992

@zyh3826
Copy link
Author

zyh3826 commented Jun 1, 2023

Got it, thanks for your reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants