Welcome to mirror list, hosted at ThFree Co, Russian Federation.

GoogleResponse.java « recognizer « speech « darkprograms « com « src - github.com/ClusterM/java-speech-api.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: da8b750d55d4e887225dbc3b359f1843c6b08ddc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package com.darkprograms.speech.recognizer;

import java.util.ArrayList;
import java.util.List;

/**
 * Class that holds the response and confidence of a Google recognizer request
 *
 * @author Luke Kuza, Duncan Jauncey, Aaron Gokaslan
 */
public class GoogleResponse {

    /**
     * Variable that holds the response
     */
    private String response;
    /**
     * Variable that holds the confidence score
     */
    private String confidence;

    /**
     * List that holds other possible responses for this request.
     */
    private List<String> otherPossibleResponses = new ArrayList<String>(20);

    /**
     * Constructor
     */
    public GoogleResponse() {

    }


    /**
     * Gets the response text of what was said in the submitted Audio to Google
     *
     * @return String representation of what was said
     */
    public String getResponse() {
        return response;
    }

    /**
     * Set the response
     *
     * @param response The response
     */
    protected void setResponse(String response) {
        this.response = response;
    }

    /**
     * Gets the confidence score for the specific request
     *
     * @return The confidence score, ex .922343324323
     */
    public String getConfidence() {
        return confidence;
    }

    /**
     * Set the confidence score for this request
     *
     * @param confidence The confidence score
     */
    protected void setConfidence(String confidence) {
        this.confidence = confidence;
    }

    /**
     * Get other possible responses for this request.
     * @return other possible responses
     */
    public List<String> getOtherPossibleResponses() {
        return otherPossibleResponses;
    }
    
    /**
     * Gets all returned responses for this request
     * @return All returned responses
     */
    public List<String> getAllPossibleResponses() {
    	List<String> tmp = otherPossibleResponses;
    	tmp.add(0,response);
    	return tmp;
    }

}