You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 3.4 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Go Text
  2. This repository holds supplementary Go libraries for text processing, many involving Unicode.
  3. ## Semantic Versioning
  4. This repo uses Semantic versioning (http://semver.org/), so
  5. 1. MAJOR version when you make incompatible API changes,
  6. 1. MINOR version when you add functionality in a backwards-compatible manner,
  7. and
  8. 1. PATCH version when you make backwards-compatible bug fixes.
  9. Until version 1.0.0 of x/text is reached, the minor version is considered a
  10. major version. So going from 0.1.0 to 0.2.0 is considered to be a major version
  11. bump.
  12. A major new CLDR version is mapped to a minor version increase in x/text.
  13. Any other new CLDR version is mapped to a patch version increase in x/text.
  14. It is important that the Unicode version used in `x/text` matches the one used
  15. by your Go compiler. The `x/text` repository supports multiple versions of
  16. Unicode and will match the version of Unicode to that of the Go compiler. At the
  17. moment this is supported for Go compilers from version 1.7.
  18. ## Download/Install
  19. The easiest way to install is to run `go get -u golang.org/x/text`. You can
  20. also manually git clone the repository to `$GOPATH/src/golang.org/x/text`.
  21. ## Contribute
  22. To submit changes to this repository, see http://golang.org/doc/contribute.html.
  23. To generate the tables in this repository (except for the encoding tables),
  24. run go generate from this directory. By default tables are generated for the
  25. Unicode version in core and the CLDR version defined in
  26. golang.org/x/text/unicode/cldr.
  27. Running go generate will as a side effect create a DATA subdirectory in this
  28. directory, which holds all files that are used as a source for generating the
  29. tables. This directory will also serve as a cache.
  30. ## Testing
  31. Run
  32. go test ./...
  33. from this directory to run all tests. Add the "-tags icu" flag to also run
  34. ICU conformance tests (if available). This requires that you have the correct
  35. ICU version installed on your system.
  36. TODO:
  37. - updating unversioned source files.
  38. ## Generating Tables
  39. To generate the tables in this repository (except for the encoding
  40. tables), run `go generate` from this directory. By default tables are
  41. generated for the Unicode version in core and the CLDR version defined in
  42. golang.org/x/text/unicode/cldr.
  43. Running go generate will as a side effect create a DATA subdirectory in this
  44. directory which holds all files that are used as a source for generating the
  45. tables. This directory will also serve as a cache.
  46. ## Versions
  47. To update a Unicode version run
  48. UNICODE_VERSION=x.x.x go generate
  49. where `x.x.x` must correspond to a directory in https://www.unicode.org/Public/.
  50. If this version is newer than the version in core it will also update the
  51. relevant packages there. The idna package in x/net will always be updated.
  52. To update a CLDR version run
  53. CLDR_VERSION=version go generate
  54. where `version` must correspond to a directory in
  55. https://www.unicode.org/Public/cldr/.
  56. Note that the code gets adapted over time to changes in the data and that
  57. backwards compatibility is not maintained.
  58. So updating to a different version may not work.
  59. The files in DATA/{iana|icu|w3|whatwg} are currently not versioned.
  60. ## Report Issues / Send Patches
  61. This repository uses Gerrit for code changes. To learn how to submit changes to
  62. this repository, see https://golang.org/doc/contribute.html.
  63. The main issue tracker for the image repository is located at
  64. https://github.com/golang/go/issues. Prefix your issue with "x/text:" in the
  65. subject line, so it is easy to find.