Documentation ¶
Overview ¶
Example (Shift_up_code_point) ¶
package main import ( "bytes" "fmt" "strings" "github.com/KEINOS/go-joyokanjis/kanjis/converter" ) func main() { tf := converter.New( // This function shifts the code point of the input rune by 1 func(in rune) rune { return in + 1 // e.g. 'a' -> 'b' }, ) // Input reader input := "abcdefgァィゥェォ" sReader := strings.NewReader(input) // Output writer var bWriter bytes.Buffer // Convert tf.Convert(sReader, &bWriter) fmt.Println(bWriter.String()) }
Output: bcdefghアイウエオ
Example (ToUpper) ¶
package main import ( "bytes" "fmt" "strings" "unicode" "github.com/KEINOS/go-joyokanjis/kanjis/converter" ) func main() { tf := converter.New( // This function converts the input rune to upper case func(in rune) rune { return unicode.ToUpper(in) }, ) // Input reader input := "Hello, World!" sReader := strings.NewReader(input) // Output writer var bWriter bytes.Buffer // Convert tf.Convert(sReader, &bWriter) fmt.Println(bWriter.String()) }
Output: HELLO, WORLD!
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
Converter is a wrapper of transform.Transformer. It provides an additional method `Convert` to convert the input to the output.
Click to show internal directories.
Click to hide internal directories.