1// Copyright 2010-2018, Google Inc.
2// All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without
5// modification, are permitted provided that the following conditions are
6// met:
7//
8//     * Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10//     * Redistributions in binary form must reproduce the above
11// copyright notice, this list of conditions and the following disclaimer
12// in the documentation and/or other materials provided with the
13// distribution.
14//     * Neither the name of Google Inc. nor the names of its
15// contributors may be used to endorse or promote products derived from
16// this software without specific prior written permission.
17//
18// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30syntax = "proto2";
31
32package mozc.user_history_predictor;
33
34message UserHistory {
35  message NextEntry {
36    // Just store the Fingerprint32(key + "\t" + value)
37    // |entry| is used as the key of LRU cache
38    optional uint32 entry_fp = 1 [ default = 0 ];
39  };
40
41  message Entry {
42    optional string key = 1 [ default = "" ];
43    optional string value = 2 [ default = "" ];
44    optional string description = 6 [ default = ""] ;
45
46    // how many times the candidate is selected via suggestion
47    optional uint32 suggestion_freq = 3 [ default = 0 ];
48
49    // how many times the candidate is selected via conversion
50    optional uint32 conversion_freq = 5 [ default = 0 ];
51
52    optional uint64 last_access_time = 4 [ default = 0 ];
53
54    // list entries which were input just after this entry.
55    repeated NextEntry next_entries = 7;
56
57    // internally used in UserHistoryPredictor.
58    optional bool bigram_boost = 20 [ default = false ];
59
60    // internally used in UserHistoryPredictor.
61    optional bool spelling_correction = 21 [ default = false ];
62
63    // This entry is removed.
64    optional bool removed = 8 [ default = false ];
65
66    enum EntryType {
67      DEFAULT_ENTRY = 0;
68      CLEAN_ALL_EVENT = 1;
69      CLEAN_UNUSED_EVENT = 2;
70    };
71
72    optional EntryType entry_type = 9 [ default = DEFAULT_ENTRY ];
73  };
74
75  repeated Entry entries = 6;
76};
77