stdlib/String: implement Unicode extended grapheme cluster segmentation

algorithm

The implementation uses a specialized trie that has not been tuned to the table
data.  I tried guessing parameter values that should work well, but did not do
any performance measurements.

There is no efficient way to initialize arrays with static data in Swift.  The
required tables are being generated as C++ code in the runtime library.

rdar://16013860


Swift SVN r19340
This commit is contained in:
Dmitri Hrybenko
2014-06-30 14:38:53 +00:00
parent a01b72ea2f
commit 4814e00fda
17 changed files with 1349 additions and 161 deletions

View File

@@ -62,6 +62,16 @@ extension String {
return IndexType(i, _core)
}
/// The end index that for this view.
@internal var _viewStartIndex: IndexType {
return IndexType(_core.startIndex, _core)
}
/// The end index that for this view.
@internal var _viewEndIndex: IndexType {
return IndexType(_core.endIndex, _core)
}
var _position: Int
var _core: _StringCore
}