1823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang/*
2823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang * Copyright (C) 2010 The Android Open Source Project
3823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang *
4823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang * Licensed under the Apache License, Version 2.0 (the "License");
5823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang * you may not use this file except in compliance with the License.
6823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang * You may obtain a copy of the License at
7823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang *
8823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang *      http://www.apache.org/licenses/LICENSE-2.0
9823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang *
10823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang * Unless required by applicable law or agreed to in writing, software
11823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang * distributed under the License is distributed on an "AS IS" BASIS,
12823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang * See the License for the specific language governing permissions and
14823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang * limitations under the License.
15823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang */
16823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang
17823b6f3516076b92f78c3fc27037d24bb514e653Ying Wangpackage com.android.common.speech;
18823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang
19823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang/**
20823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang * Utilities for voice recognition implementations.
21823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang *
22823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang * @see android.speech.RecognitionService
23823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang * @see android.speech.RecognizerIntent
24823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang */
25823b6f3516076b92f78c3fc27037d24bb514e653Ying Wangpublic class Recognition {
26823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang
27823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang    /**
28823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * The key to the extra in the Bundle returned by
29823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * android.speech.RecognizerIntent#ACTION_GET_LANGUAGE_DETAILS
30823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * which is an ArrayList of CharSequences which are hints that can be shown to
31823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * the user for voice actions currently supported by voice search for the user's current
32823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * language preference for voice search (i.e., the one defined in the extra
33823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * android.speech.RecognizerIntent#EXTRA_LANGUAGE_PREFERENCE).
34823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     *
35823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * If this is paired with EXTRA_HINT_CONTEXT, should return a set of hints that are
36823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * appropriate for the provided context.
37823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     *
38823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * The CharSequences are SpannedStrings and will contain segments wrapped in
39823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * <annotation action="true"></annotation>. This is to indicate the section of the text
40823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * which represents the voice action, to be highlighted in the UI if so desired.
41823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     */
42823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang    public static final String EXTRA_HINT_STRINGS = "android.speech.extra.HINT_STRINGS";
43823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang
44823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang    /**
45823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * The key to an extra to be included in the request intent for
46823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * android.speech.RecognizerIntent#ACTION_GET_LANGUAGE_DETAILS.
47823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * Should be an int of one of the values defined below. If an
48823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * unknown int value is provided, it should be ignored.
49823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     */
50823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang    public static final String EXTRA_HINT_CONTEXT = "android.speech.extra.HINT_CONTEXT";
51823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang
52823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang    /**
53823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     * A set of values for EXTRA_HINT_CONTEXT.
54823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang     */
55823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang    public static final int HINT_CONTEXT_UNKNOWN = 0;
56823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang    public static final int HINT_CONTEXT_VOICE_SEARCH_HELP = 1;
57823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang    public static final int HINT_CONTEXT_CAR_HOME = 2;
58823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang    public static final int HINT_CONTEXT_LAUNCHER = 3;
59823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang
60823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang    private Recognition() { }   // don't instantiate
61823b6f3516076b92f78c3fc27037d24bb514e653Ying Wang}
62