Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1874)

Issue 6073043: Change the API to fetch candidates incrementally. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years ago by hsumita1
Modified:
12 years ago
Reviewers:
Peng Huang, penghuang
Base URL:
git@github.com:pyzy/pyzy.git@master
Visibility:
Public.

Description

Change the API to fetch candidates incrementally. BUG=Conversion is slow TEST=Test manually with client applications.

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 8

Patch Set 7 : #

Patch Set 8 : Fixes a bug. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -153 lines) Patch
M configure.ac View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M src/Makefile.am View 1 2 3 4 2 chunks +0 lines, -2 lines 0 comments Download
M src/PyZyBopomofoContext.cc View 1 2 2 chunks +2 lines, -3 lines 0 comments Download
D src/PyZyCandidates.h View 1 2 1 chunk +0 lines, -47 lines 0 comments Download
D src/PyZyCandidates.cc View 1 2 1 chunk +0 lines, -48 lines 0 comments Download
M src/PyZyInputContext.h View 1 2 3 4 5 6 3 chunks +3 lines, -8 lines 0 comments Download
M src/PyZyPhoneticContext.h View 1 2 5 chunks +3 lines, -4 lines 0 comments Download
M src/PyZyPhoneticContext.cc View 1 2 3 4 5 6 7 6 chunks +56 lines, -35 lines 0 comments Download
M src/PyZyPhraseEditor.h View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M src/PyZyPinyinContext.cc View 1 2 2 chunks +2 lines, -3 lines 0 comments Download

Messages

Total messages: 4
hsumita1
12 years ago (2012-04-20 14:39:45 UTC) #1
hsumita1
On 2012/04/20 14:39:45, hsumita1 wrote: Ping?
12 years ago (2012-04-24 06:23:49 UTC) #2
Peng Huang
lgtm with few comments. Sorry for the late reply. http://codereview.appspot.com/6073043/diff/10001/src/PyZyInputContext.h File src/PyZyInputContext.h (right): http://codereview.appspot.com/6073043/diff/10001/src/PyZyInputContext.h#newcode46 src/PyZyInputContext.h:46: ...
12 years ago (2012-04-24 13:48:24 UTC) #3
hsumita1
12 years ago (2012-04-25 00:25:23 UTC) #4
http://codereview.appspot.com/6073043/diff/10001/src/PyZyInputContext.h
File src/PyZyInputContext.h (right):

http://codereview.appspot.com/6073043/diff/10001/src/PyZyInputContext.h#newco...
src/PyZyInputContext.h:46: virtual bool has (size_t index) = 0;
On 2012/04/24 13:48:24, Peng Huang wrote:
> ) const = 0?

We can't add const identifier because has() function may fetch some data from
database.

Sorry, but I have forgotten to removes Candidates class.

I want to obsolete this class, because
- Other accessors belong to InputContext class.
- To implements Candidates class, Candidates class should have the pointer to
the instance of InputContext or PhraseEditor to get a candidates. I think it is
not a good design.

http://codereview.appspot.com/6073043/diff/10001/src/PyZyInputContext.h#newco...
src/PyZyInputContext.h:47: virtual bool get (size_t index, Candidate &
candidate) = 0;
On 2012/04/24 13:48:24, Peng Huang wrote:
> ) const = 0?

ditto.

http://codereview.appspot.com/6073043/diff/10001/src/PyZyInputContext.h#newco...
src/PyZyInputContext.h:98: virtual bool getCandidate (size_t i, Candidate &
output) = 0;
On 2012/04/24 13:48:24, Peng Huang wrote:
> If possible, consider using ()const = 0.

hasCandidate and getCandidate may fetch some data from database, so we can't add
const identifier.

http://codereview.appspot.com/6073043/diff/10001/src/PyZyPhoneticContext.cc
File src/PyZyPhoneticContext.cc (right):

http://codereview.appspot.com/6073043/diff/10001/src/PyZyPhoneticContext.cc#n...
src/PyZyPhoneticContext.cc:225: while (i >= m_special_phrases.size () +
m_phrase_editor.candidates ().size ()) {
On 2012/04/24 13:48:24, Peng Huang wrote:
> too long?

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b