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

Issue 23220043: code review 23220043: go.text/transform: added RemoveFunc transform for remov... (Closed)

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

Description

go.text/transform: added RemoveFunc transform for removing individual runes from the input. This corresponds to ICU's Remove transform. For example, to remove accents from characters one could use RemoveFunc as follows: nonspacingMark := func(r rune) bool { return unicode.Is(unicode.Mn, r) } transform.Chain(norm.NFD, transform.RemoveFunc(nonspacingMark), norm.NFC) (Once norm.Form implements Transformer; guess what will be my next CL.)

Patch Set 1 #

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

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

Total comments: 2

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+198 lines, -2 lines) Patch
A transform/examples_test.go View 1 1 chunk +37 lines, -0 lines 0 comments Download
M transform/transform.go View 1 2 3 2 chunks +55 lines, -2 lines 0 comments Download
M transform/transform_test.go View 1 2 2 chunks +106 lines, -0 lines 0 comments Download

Messages

Total messages: 5
mpvl
Hello r@golang.org (cc: golang-dev@googlegroups.com, nigeltao@golang.org), I'd like you to review this change to https://code.google.com/p/go.text
11 years, 6 months ago (2013-11-07 21:45:22 UTC) #1
mpvl
Hi Rob, Did you have a chance to look at this yet? The norm blog ...
11 years, 6 months ago (2013-11-22 11:17:06 UTC) #2
r
LGTM https://codereview.appspot.com/23220043/diff/40001/transform/transform.go File transform/transform.go (right): https://codereview.appspot.com/23220043/diff/40001/transform/transform.go#newcode420 transform/transform.go:420: // is true from the input. Illegal bytes ...
11 years, 5 months ago (2013-11-25 15:11:41 UTC) #3
mpvl
*** Submitted as https://code.google.com/p/go/source/detail?r=7c893d4d9458&repo=text *** go.text/transform: added RemoveFunc transform for removing individual runes from the ...
11 years, 5 months ago (2013-11-26 07:29:29 UTC) #4
mpvl
11 years, 5 months ago (2013-11-26 08:18:09 UTC) #5
Message was sent while issue was closed.
https://codereview.appspot.com/23220043/diff/40001/transform/transform.go
File transform/transform.go (right):

https://codereview.appspot.com/23220043/diff/40001/transform/transform.go#new...
transform/transform.go:420: // is true from the input. Illegal bytes in the
input are replaced by RuneError.
On 2013/11/25 15:11:41, r wrote:
> RemoveFunc returns a Transformer that removes from the input all runes r for
> which f(r) is true.

Done.
Sign in to reply to this message.

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