@@ -42,6 +42,7 @@ public static class Builder {
4242 private Boolean timestamps ;
4343 private Double wordAlternativesThreshold ;
4444 private Boolean wordConfidence ;
45+ private Boolean profanityFilter ;
4546
4647
4748 private Builder (RecognizeOptions options ) {
@@ -57,6 +58,7 @@ private Builder(RecognizeOptions options) {
5758 this .timestamps = options .timestamps ;
5859 this .wordAlternativesThreshold = options .wordAlternativesThreshold ;
5960 this .wordConfidence = options .wordConfidence ;
61+ this .profanityFilter = options .profanityFilter ;
6062 }
6163
6264 /**
@@ -99,6 +101,19 @@ public Builder contentType(String contentType) {
99101 }
100102
101103
104+ /**
105+ * If true, filters profanity from all output except for keyword results by
106+ * replacing inappropriate words with a series of asterisks. Set the parameter to false to
107+ * return results with no censoring. Applies to US English transcription only.
108+ *
109+ * @param profanityFilter the profanity filter
110+ * @return the recognize options
111+ */
112+ public Builder profanityFilter (Boolean profanityFilter ) {
113+ this .profanityFilter = profanityFilter ;
114+ return this ;
115+ }
116+
102117 /**
103118 * If true, multiple final results that represent multiple consecutive phrases separated by
104119 * pauses are returned. Otherwise, the recognition ends after first "end of speech" is detected.
@@ -262,7 +277,7 @@ public Builder wordConfidence(Boolean wordConfidence) {
262277 @ SerializedName ("keywords_threshold" )
263278 private Double keywordsThreshold ;
264279 private Integer maxAlternatives ;
265-
280+ private Boolean profanityFilter ;
266281 private String model ;
267282 private String sessionId ;
268283 private Boolean timestamps ;
@@ -284,6 +299,7 @@ private RecognizeOptions(Builder builder) {
284299 this .timestamps = builder .timestamps ;
285300 this .wordAlternativesThreshold = builder .wordAlternativesThreshold ;
286301 this .wordConfidence = builder .wordConfidence ;
302+ this .profanityFilter = builder .profanityFilter ;
287303 }
288304
289305 /**
@@ -295,7 +311,15 @@ public String contentType() {
295311 return contentType ;
296312 }
297313
298-
314+ /**
315+ * Gets the profanity filter
316+ *
317+ * @return the profanity filter
318+ */
319+ public Boolean profanityFilter () {
320+ return profanityFilter ;
321+ }
322+
299323 /**
300324 * Gets the continuous.
301325 *
0 commit comments