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

Issue 122420043: code review 122420043: go.text/cases: first stab at cases package. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 9 months ago by mpvl
Modified:
9 years, 6 months ago
Reviewers:
nigeltao, r
CC:
nigeltao, r, golang-codereviews
Visibility:
Public.

Description

go.text/cases: first stab at cases package. Overview Includes language-specific casing. Title caser uses a close approximation of the Unicode Word Breaking Algorithm. Most information needed for case mapping is stored in a single trie. Core files: cases.go: API casemap.go: per-language, high-level case mappings context.go: trie lookup wrapper and state management

Patch Set 1 #

Patch Set 2 : diff -r d65bffbc88a1 https://code.google.com/p/go.text #

Patch Set 3 : diff -r d65bffbc88a1 https://code.google.com/p/go.text #

Total comments: 68

Patch Set 4 : diff -r d65bffbc88a1 https://code.google.com/p/go.text #

Total comments: 14

Patch Set 5 : diff -r a18e7d21c06d https://code.google.com/p/go.text #

Patch Set 6 : diff -r 12288f41f508 https://code.google.com/p/go.text #

Total comments: 43

Patch Set 7 : diff -r 12288f41f508 https://code.google.com/p/go.text #

Total comments: 21

Patch Set 8 : diff -r 024681b033be https://code.google.com/p/go.text #

Patch Set 9 : diff -r 024681b033be https://code.google.com/p/go.text #

Total comments: 18

Patch Set 10 : diff -r 024681b033be https://code.google.com/p/go.text #

Total comments: 41

Patch Set 11 : diff -r 1ac75970ff9e https://code.google.com/p/go.text #

Patch Set 12 : diff -r 1ac75970ff9e https://code.google.com/p/go.text #

Total comments: 48

Patch Set 13 : diff -r f8db539672d0 https://code.google.com/p/go.text #

Total comments: 14

Patch Set 14 : diff -r f8db539672d0 https://code.google.com/p/go.text #

Patch Set 15 : diff -r f8db539672d0 https://code.google.com/p/go.text #

Patch Set 16 : diff -r f8db539672d0 https://code.google.com/p/go.text #

Patch Set 17 : diff -r b8406a47db8d https://code.google.com/p/go.text #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1932 lines, -0 lines) Patch
A cases/cases.go View 1 chunk +105 lines, -0 lines 0 comments Download
A cases/context.go View 1 chunk +178 lines, -0 lines 0 comments Download
A cases/context_test.go View 1 chunk +353 lines, -0 lines 0 comments Download
A cases/example_test.go View 1 chunk +53 lines, -0 lines 0 comments Download
A cases/map.go View 1 chunk +672 lines, -0 lines 0 comments Download
A cases/map_test.go View 1 chunk +571 lines, -0 lines 0 comments Download

Messages

Total messages: 28
mpvl
Hello nigeltao@golang.org (cc: golang-codereviews@googlegroups.com, r@golang.org), I'd like you to review this change to https://code.google.com/p/go.text
9 years, 9 months ago (2014-08-12 19:18:17 UTC) #1
nigeltao
I haven't digested all of this yet, but here's a first round of mostly trivial ...
9 years, 9 months ago (2014-08-13 06:26:31 UTC) #2
nigeltao
In the CL description: s/gettest/gentest/ and s/differes/differs/
9 years, 9 months ago (2014-08-13 06:27:07 UTC) #3
mpvl
https://codereview.appspot.com/122420043/diff/40001/cases/cases.go File cases/cases.go (right): https://codereview.appspot.com/122420043/diff/40001/cases/cases.go#newcode35 cases/cases.go:35: // to Bytes or String or to reuse a ...
9 years, 9 months ago (2014-08-13 15:26:06 UTC) #4
nigeltao
Some more mostly trivial comments. I haven't had the time this week to give it ...
9 years, 8 months ago (2014-08-22 07:00:23 UTC) #5
mpvl
[sorry, had a bunch of replies, but forgot to send out.] In the mean time ...
9 years, 8 months ago (2014-09-03 07:51:54 UTC) #6
nigeltao
Another round of comments. I still haven't found the time to try to digest the ...
9 years, 8 months ago (2014-09-12 09:58:11 UTC) #7
mpvl
https://codereview.appspot.com/122420043/diff/100001/cases/casemap.go File cases/casemap.go (right): https://codereview.appspot.com/122420043/diff/100001/cases/casemap.go#newcode12 cases/casemap.go:12: "code.google.com/p/go.text/transform" On 2014/09/12 09:58:10, nigeltao wrote: > Move this ...
9 years, 8 months ago (2014-09-13 10:01:39 UTC) #8
nigeltao
I dropped a few more comments, but I have a bigger design question: Currently, a ...
9 years, 7 months ago (2014-09-22 09:57:37 UTC) #9
mpvl
Some comments for now. Still working on this, including reworking checkpointing etc. to allow your ...
9 years, 7 months ago (2014-09-24 13:08:18 UTC) #10
nigeltao
https://codereview.appspot.com/122420043/diff/120001/cases/casemap.go File cases/casemap.go (right): https://codereview.appspot.com/122420043/diff/120001/cases/casemap.go#newcode433 cases/casemap.go:433: for i := 0; !c.done() && i <= maxIgnorable-1; ...
9 years, 7 months ago (2014-09-25 00:06:20 UTC) #11
mpvl
Did another iteration incorporating many of your ideas from CL 142380043, but taking a different ...
9 years, 7 months ago (2014-09-25 19:37:38 UTC) #12
nigeltao
https://codereview.appspot.com/122420043/diff/160001/cases/casemap.go File cases/casemap.go (right): https://codereview.appspot.com/122420043/diff/160001/cases/casemap.go#newcode25 cases/casemap.go:25: type MapFunc func(*context) bool s/MapFunc/mapFunc/ unless there's a reason ...
9 years, 7 months ago (2014-09-29 07:15:14 UTC) #13
mpvl
https://codereview.appspot.com/122420043/diff/160001/cases/casemap.go File cases/casemap.go (right): https://codereview.appspot.com/122420043/diff/160001/cases/casemap.go#newcode25 cases/casemap.go:25: type MapFunc func(*context) bool On 2014/09/29 07:15:14, nigeltao wrote: ...
9 years, 7 months ago (2014-10-06 09:41:16 UTC) #14
nigeltao
In an effort to cut this CL into managable chunks, I split off the Unicode ...
9 years, 7 months ago (2014-10-08 08:34:07 UTC) #15
mpvl
SGTM. I'll remove the generation code from this CL once the other one is checked ...
9 years, 7 months ago (2014-10-08 09:29:29 UTC) #16
nigeltao
https://codereview.appspot.com/122420043/diff/180001/cases/casemap.go File cases/casemap.go (right): https://codereview.appspot.com/122420043/diff/180001/cases/casemap.go#newcode52 cases/casemap.go:52: // Transformers and safe a bit on runtime allocations. ...
9 years, 7 months ago (2014-10-13 06:37:43 UTC) #17
nigeltao
On 2014/10/08 09:29:29, mpvl wrote: > SGTM. I'll remove the generation code from this CL ...
9 years, 7 months ago (2014-10-13 06:38:30 UTC) #18
mpvl
https://codereview.appspot.com/122420043/diff/180001/cases/casemap.go File cases/casemap.go (right): https://codereview.appspot.com/122420043/diff/180001/cases/casemap.go#newcode24 cases/casemap.go:24: // cause written bytes to be modified (analogous to ...
9 years, 7 months ago (2014-10-13 18:36:55 UTC) #19
nigeltao
https://codereview.appspot.com/122420043/diff/180001/cases/context.go File cases/context.go (right): https://codereview.appspot.com/122420043/diff/180001/cases/context.go#newcode32 cases/context.go:32: info caseInfo // case information of currently scanned rune ...
9 years, 7 months ago (2014-10-21 05:42:01 UTC) #20
mpvl
https://codereview.appspot.com/122420043/diff/180001/cases/context.go File cases/context.go (right): https://codereview.appspot.com/122420043/diff/180001/cases/context.go#newcode32 cases/context.go:32: info caseInfo // case information of currently scanned rune ...
9 years, 6 months ago (2014-10-21 15:15:50 UTC) #21
nigeltao
I ran out of time today, and haven't looked closely at the latest round, but ...
9 years, 6 months ago (2014-10-22 06:52:58 UTC) #22
mpvl
https://codereview.appspot.com/122420043/diff/220001/cases/context.go File cases/context.go (right): https://codereview.appspot.com/122420043/diff/220001/cases/context.go#newcode50 cases/context.go:50: if c.atEOF && c.pSrc == len(c.src) || c.nSrc == ...
9 years, 6 months ago (2014-10-22 12:19:53 UTC) #23
nigeltao
LGTM, but wait for r. Thanks for your patience with this code review. One last ...
9 years, 6 months ago (2014-10-23 06:29:44 UTC) #24
mpvl
Thanks for the very thorough review! It was worth the wait. :) https://codereview.appspot.com/122420043/diff/220001/cases/casemap.go File cases/casemap.go ...
9 years, 6 months ago (2014-10-27 12:38:31 UTC) #25
r
LGTM For future big packages like this, please make it easier for the reviewers by ...
9 years, 6 months ago (2014-11-05 23:42:48 UTC) #26
mpvl
Thanks for the review. I did write down the gist of the design a while ...
9 years, 6 months ago (2014-11-06 09:25:06 UTC) #27
mpvl
9 years, 6 months ago (2014-11-10 16:26:26 UTC) #28
*** Submitted as
https://code.google.com/p/go/source/detail?r=f230eca7a943&repo=text ***

go.text/cases: first stab at cases package.

Overview
Includes language-specific casing. Title caser uses a close
approximation of the Unicode Word Breaking Algorithm. Most
information needed for case mapping is stored in a single
trie.

Core files:
cases.go:    API
casemap.go:  per-language, high-level case mappings
context.go:  trie lookup wrapper and state management

LGTM=nigeltao, r
R=nigeltao, r
CC=golang-codereviews
https://codereview.appspot.com/122420043
Sign in to reply to this message.

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