| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Added setEnableWordTimeOffsets(false) to Sync samples and quick start
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.
|
Sorry, something went wrong.
|
I am covered by my current employer (Google) |
Sorry, something went wrong.
| .setEncoding(AudioEncoding.FLAC) | ||
| .setLanguageCode("en-US") | ||
| .setSampleRateHertz(16000) | ||
| .setEnableWordTimeOffsets(false) |
There was a problem hiding this comment.
Isn't false the default?
Sorry, something went wrong.
| .setEncoding(AudioEncoding.LINEAR16) | ||
| .setLanguageCode("en-US") | ||
| .setSampleRateHertz(16000) | ||
| .setEnableWordTimeOffsets(false) |
There was a problem hiding this comment.
Isn't false the default?
Sorry, something went wrong.
| List<SpeechRecognitionAlternative> alternatives = result.getAlternativesList(); | ||
| for (SpeechRecognitionAlternative alternative: alternatives) { | ||
| System.out.printf("Transcription: %s%n", alternative.getTranscript()); | ||
| for (WordInfo wordInfo: alternative.getWordsList()) { |
There was a problem hiding this comment.
Please add a test for this.
Sorry, something went wrong.
There was a problem hiding this comment.
Done. I added the test. I also fixed the test failure in AsyncRecognizeGcs test, so all the tests should pass now
Sorry, something went wrong.
| for (WordInfo wordInfo: alternative.getWordsList()) { | ||
| System.out.println(wordInfo.getWord()); | ||
| System.out.printf("\t%s ns - %s ns\n", | ||
| wordInfo.getStartTime().getNanos(), wordInfo.getEndTime().getNanos()); |
There was a problem hiding this comment.
You're missing seconds, this just shows the nanoseconds for portions of the response.
Sorry, something went wrong.
There was a problem hiding this comment.
Please update the other async sample to correctly show the seconds and nanos calculated to second fractions.
Sorry, something went wrong.
There was a problem hiding this comment.
your original code did not have seconds, and I did not change the "pretty print" to show seconds.
Sorry, something went wrong.
| .setEncoding(AudioEncoding.LINEAR16) | ||
| .setSampleRateHertz(16000) | ||
| .setLanguageCode("en-US") | ||
| .setEnableWordTimeOffsets(false) |
There was a problem hiding this comment.
Isn't this superfluous as false is the default?
Sorry, something went wrong.
There was a problem hiding this comment.
I'm pretty sure we don't want to set an optional parameter to its default value in the quickstart example. Thoughts?
Sorry, something went wrong.
Fixed the tests for WordTimeOffsets
|
CLAs look good, thanks! |
Sorry, something went wrong.
| List<SpeechRecognitionAlternative> alternatives = result.getAlternativesList(); | ||
| for (SpeechRecognitionAlternative alternative: alternatives) { | ||
| System.out.printf("Transcription: %s%n", alternative.getTranscript()); | ||
| System.out.printf("Transcription: %s\n",alternative.getTranscript()); |
There was a problem hiding this comment.
This should be:
System.out.printf("\t%s.%s sec - %s.%s sec\n",
wordInfo.getStartTime().getSeconds(),
wordInfo.getStartTime().getNanos() / 100000000,
wordInfo.getEndTime().getSeconds(),
wordInfo.getEndTime().getNanos() / 100000000);
}
Sorry, something went wrong.
There was a problem hiding this comment.
This line shows the all up transcript - lines bellow it are iterating through the words and displaying the start and end time stamps
Sorry, something went wrong.
| Recognize.asyncRecognizeGcs(gcsPath); | ||
| String got = bout.toString(); | ||
| assertThat(got).contains("\t0.0 sec -"); | ||
| assertThat(got).contains("\t0 ns"); |
There was a problem hiding this comment.
Revert this change when you correct the print output in asyncRecognizeFile
Sorry, something went wrong.
|
@dlaqab Please update your branch to match master, change your new code to match the updated start seconds / end seconds code as: System.out.printf("\t%s.%s sec - %s.%s sec\n",
wordInfo.getStartTime().getSeconds(),
wordInfo.getStartTime().getNanos() / 100000000,
wordInfo.getEndTime().getSeconds(),
wordInfo.getEndTime().getNanos() / 100000000);
}
Revert your change in RecognizeIT to test for actual seconds / fractions of a second. |
Sorry, something went wrong.
|
@lesv /FYI - Looks like the Circle tests are not running because this is on a personal fork of the repo. When I run the tests locally, the following is my output:
Checkstyle shows:
So mostly LGTM, I'm just a little concerned about setting the optional parameter to its default value in the Quickstart still. |
Sorry, something went wrong.
|
@gguuss I'll try to fix that tomorrow. |
Sorry, something went wrong.
There was a problem hiding this comment.
I feel we may want to at some point remove the .setEnableWordTimeOffsets(false) calls but reluctantly approving for today.
Sorry, something went wrong.
|
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate. |
Sorry, something went wrong.
|
I signed it! |
Sorry, something went wrong.
There was a problem hiding this comment.
Will make change separately to match other samples.
Sorry, something went wrong.
|
This can be closed. |
Sorry, something went wrong.
|
why? I am not sure why this needs to be closed |
Sorry, something went wrong.
|
Sorry, something went wrong.
|
The setEnableWordTimeOffsets() call in these samples is extraneous to the task these samples are intended to demonstrate. Closing. |
Sorry, something went wrong.
|
Note: samples which demonstrate Enable Word Time Offsets were added to java-docs-samples in #787 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Added setEnableWordTimeOffsets(true) to Async Recognize for a File
Added setEnableWordTimeOffsets(false) to Sync samples and quick start