Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cl-scsu Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 12:46:33 2020 GMT+0.
• Introduction | What cl-scsu is all about | |
• Systems | The systems documentation | |
• Modules | The modules documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
Standard Compression Scheme for Unicode の Common Lisp 実装。
cl-scsu is an implementation of Standard Compression Scheme for Unicode by Common Lisp.
The MIT License. See LICENSE file.
(ql:quickload "cl-scsu")
(asdf:load-asd "cl-scsu.asd")
(asdf:load-system :cl-scsu)
For running tests, do below additionally.
(asdf:load-asd "cl-scsu-test.asd")
(asdf:test-system :cl-scsu)
Makes a test string, estimated 38 bytes long by counting Japanese characters as 2 bytes.
CL-USER> (defvar *test-string* "abcde あいうえお アイウエオ 阿伊宇江於")
*TEST-STRING*
Let's compress it. The result is only 30 bytes long.
CL-USER> (cl-scsu:encode-from-string *test-string*)
#(97 98 99 100 101 32 21 130 132 134 136 138 32 226 228 230 232 234 32
15 150 63 79 10 91 135 108 95 101 188) ; compressin result
30 ; number of result bytes
23 ; number of read characters
#<CL-SCSU:SCSU-STATE @ #x10002ed37c2> ; scsu state object
To restore the original string, decompress the bytes.
CL-USER> (cl-scsu:decode-to-string *)
"abcde あいうえお アイウエオ 阿伊宇江於" ; decompression result
23 ; number of result characters
30 ; number of read bytes
#<CL-SCSU:SCSU-STATE @ #x10002f469f2> ; scsu state object
Please see docstrings of symbols exported from cl-scsu
package:
decode-to-string
encode-from-string
encode-reset-sequence
Next: Modules, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The cl-scsu system |
YOKOTA Yuki <y2q.actionman@gmail.com>
MIT
An implementation of ’Standard Compression Scheme for Unicode’.
alexandria
cl-scsu.asd (file)
src (module)
Modules are listed depth-first from the system components tree.
• The cl-scsu/src module |
cl-scsu (system)
src/
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The cl-scsu.asd file | ||
• The cl-scsu/src/package.lisp file | ||
• The cl-scsu/src/constant.lisp file | ||
• The cl-scsu/src/scsu.lisp file |
Next: The cl-scsu/src/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
cl-scsu.asd
cl-scsu (system)
Next: The cl-scsu/src/constant․lisp file, Previous: The cl-scsu․asd file, Up: Lisp files [Contents][Index]
Next: The cl-scsu/src/scsu․lisp file, Previous: The cl-scsu/src/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
src (module)
src/constant.lisp
scsu-error (condition)
Previous: The cl-scsu/src/constant․lisp file, Up: Lisp files [Contents][Index]
constant.lisp (file)
src (module)
src/scsu.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The cl-scsu package |
package.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported functions | ||
• Exported conditions | ||
• Exported classes |
Next: Exported conditions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
This function decompresses BYTES compressed by the SCSU and returns the result as a string.
Returned values are following:
1. The result string decompressed by SCSU.
2. The position of the next of the last character written to the result string.
3. The position of the next of the last byte read from BYTES.
4. ‘scsu-state’ object.
Arguments are:
- BYTES
A byte sequence compressed by SCSU.
- START1, END1
Specifies the range of BYTES argument should be used.
Initial value is 0 and the length of BYTES respectively.
- STRING
Specifies an output storage filled by the decompression result.
This specified string is returned by ‘decode-to-string’.
If not specified, a new string is allocated and returned.
- START2, END2
Specifies the range of STRING argument used.
Initial value is 0 and the length of STRING respectively.
If STRING is not specified, these arguments are ignored.
- STATE
If specifies a ‘scsu-state’ object returned by previous ‘decode-to-string’ calls,
the shift state included the object is used.
If not specified, the initial state [http://unicode.org/reports/tr6/#Initial_State] is used.
====
BYTES に渡された SCSU で圧縮されたバイト列を文字列に変換して返す。
戻値は以下の通り:
1. SCSU解凍結果の文字列
2. 1. で返された文字列に、最後に書き出した文字の次の位置
3. BYTES で渡したバイト列で、最後に読み込んだバイトの次の位置
4. ‘scsu-state’ オブジェクト
引数:
- BYTES
SCSU圧縮されたバイト列。
- START1, END1
BYTES 引数に渡したバイト列の使用範囲を指定する。初期値は、それぞれ ‘0’ と BYTES の長さ.
- STRING
SCSU解凍結果を格納する先の文字列。ここで指定された文字列が返される。
未指定の場合、新しい文字列を割り当てて返す。
- START2, END2
STRING 引数に渡した文字列の使用範囲を指定する。
初期値は、それぞれ 0 と STRING の長さ.
STRING を指定しなかった場合、無視される。
- STATE
他の ‘decode-to-string’ 呼び出しで返された ‘scsu-state’ オブジェクトを
渡すことにより、シフト状態などを引き継いで使用できる。
指定しない場合、 初期シフト状態 [http://unicode.org/reports/tr6/#Initial_State] を使用する。
This function compresses STRING by SCSU and returns the result as a byte sequence.
Returned values are following:
1. The result byte sequence compressed by SCSU.
2. The position of the next of the last byte written to the result byte sequence.
3. The position of the next of the last characted read from STRING.
4. ‘scsu-state’ object.
Arguments are:
- STRING
A string to be compressed by SCSU.
- START1, END1
Specifies the range of STRING argument should be used.
Initial value is 0 and the length of STRING respectively.
- BYTES
Specifies an output storage filled by the compression result.
This specified byte sequence is returned by ‘encode-from-string’.
If not specified, a new byte sequence is allocated and returned.
- START2, END2
Specifies the range of BYTES argument used.
Initial value is 0 and the length of BYTES respectively.
If BYTES is not specified, these arguments are ignored.
- INITIAL-PRIORITY
Specifies how to determine the priority of the initial dynamic window [http://unicode.org/reports/tr6/#Initial_Window] of SCSU as following:
- ‘:lookahead’ (default) :: Determines by lookaheading STRING argument.
- ‘:fixed’ :: Don’t change dynamic window.
- ‘:random’ :: determines randomly.
- an interger array :: Uses the array as a priority. Bigger is prior.
- STATE
If specifies a ‘scsu-state’ object returned by previous ‘encode-from-string’ calls,
the shift state included the object is used.
If not specified, the initial state [http://unicode.org/reports/tr6/#Initial_State] is used.
====
STRING を SCSU で圧縮したバイト列に変換して返す。
戻値は以下の通り:
1. SCSU圧縮結果のバイト列
2. 1. で返されたバイト列に、最後に書き出したバイトの次の位置
3. BYTES で渡した文字列で、最後に読み込んだ文字の次の位置
4. ‘scsu-state’ オブジェクト
- STRING
SCSU圧縮する文字列。
- START1, END1
STRING 引数に渡した文字列の使用範囲を指定する。初期値は、それぞれ 0 と STRING の長さ.
- BYTES
SCSU圧縮結果を格納する先のバイト列。ここで指定されたバイト列が返される。
未指定の場合、新しいバイト列を割り当てて返す。
- START2, END2
BYTES 引数に渡したバイト列の使用範囲を指定する。
初期値は、それぞれ 0 と BYTES の長さ.
BYTES を指定しなかった場合、無視される。
- INITIAL-PRIORITY
SCSUの 初期 dynamic window [http://unicode.org/reports/tr6/#Initial_Window] の優先順序を指定する。指定可能な値は以下の通り:
- ‘:LOOKAHEAD’ (初期値) :: STRING 引数の内容を先読みして決定する。
- ‘:fixed’ :: dynamic window を変更しない。
- ‘:random’ :: 乱数で適当に決める。
- 数値配列 :: 渡した数列を初期 dynamic window の優先度として使用する。大きい値が優先される。
- STATE
他の ‘encode-from-string’ 呼び出しで返された ‘scsu-state’ オブジェクトを
渡すことにより、シフト状態などを引き継いで使用できる。
指定しない場合、 初期シフト状態 [http://unicode.org/reports/tr6/#Initial_State] を使用する。
This function returns a byte sequence to change STATE to the initial state.
Returned values are following:
1. A byte sequence.
2. The position of the next of the last byte written to the result byte sequence.
3. ‘scsu-state’ object.
Arguments are:
- STATE
A ‘scsu-state’ object.
- BYTES
Specifies an output storage filled by the result.
This specified byte sequence is returned by ‘encode-reset-sequence’.
If not specified, a new byte sequence is allocated and returned.
- START, END
Specifies the range of BYTES argument used.
Initial value is 0 and the length of BYTES respectively.
If BYTES is not specified, these arguments are ignored.
====
STATE の内部状態を SCSU の初期状態に戻すためのバイト列を返す。
戻値は以下の通り:
1. バイト列
2. 1. で返されたバイト列に、最後に書き出したバイトの次の位置
3. ‘scsu-state’ オブジェクト
- STATE
‘scsu-state’ オブジェクト.
- BYTES
格納先のバイト列。ここで指定されたバイト列が返される。
未指定の場合、新しいバイト列を割り当てて返す。
- START, END
BYTES 引数に渡したバイト列の使用範囲を指定する。
初期値は、それぞれ 0 と BYTES の長さ.
BYTES を指定しなかった場合、無視される。
Next: Exported classes, Previous: Exported functions, Up: Exported definitions [Contents][Index]
If some error occurs in ‘decode-to-string’,
‘encode-from-string’, or ‘encode-reset-sequence’, this condition is reported.
====
‘decode-to-string’, ‘encode-from-string’, ‘encode-reset-sequence’ で
エラーが発生した場合、この condition が報告される。
constant.lisp (file)
simple-error (condition)
(quote nil)
scsu-error-src-error-position (generic function)
(setf scsu-error-src-error-position) (generic function)
(quote nil)
scsu-error-dst-error-position (generic function)
(setf scsu-error-dst-error-position) (generic function)
cl-scsu::parental-condition
(quote nil)
scsu-error-parental-condition (generic function)
(setf scsu-error-parental-condition) (generic function)
Previous: Exported conditions, Up: Exported definitions [Contents][Index]
The class of an object holding the internal state of SCSU.
====
SCSUの内部状態を保持するオブジェクトのクラス。
scsu.lisp (file)
standard-object (class)
:single-byte-mode
scsu-state-mode (generic function)
(setf scsu-state-mode) (generic function)
scsu-state-dynamic-window (generic function)
(setf scsu-state-dynamic-window) (generic function)
cl-scsu::window-index
0
scsu-state-active-window-index (generic function)
(setf scsu-state-active-window-index) (generic function)
scsu-state-timestamp-vector (generic function)
(setf scsu-state-timestamp-vector) (generic function)
fixnum
0
scsu-state-current-timestamp (generic function)
(setf scsu-state-current-timestamp) (generic function)
boolean
:fix-dynamic-window
scsu-state-fix-dynamic-window (generic function)
(setf scsu-state-fix-dynamic-window) (generic function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal constants | ||
• Internal special variables | ||
• Internal macros | ||
• Internal functions | ||
• Internal generic functions | ||
• Internal types |
Next: Internal special variables, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
constant.lisp (file)
Change to Window 0
constant.lisp (file)
Change to Window 1
constant.lisp (file)
Change to Window 2
constant.lisp (file)
Change to Window 3
constant.lisp (file)
Change to Window 4
constant.lisp (file)
Change to Window 5
constant.lisp (file)
Change to Window 6
constant.lisp (file)
Change to Window 7
constant.lisp (file)
Change to Unicode
constant.lisp (file)
Define Window 0
constant.lisp (file)
Define Window 1
constant.lisp (file)
Define Window 2
constant.lisp (file)
Define Window 3
constant.lisp (file)
Define Window 4
constant.lisp (file)
Define Window 5
constant.lisp (file)
Define Window 6
constant.lisp (file)
Define Window 7
constant.lisp (file)
Define Extended
constant.lisp (file)
Quote from Window 0
constant.lisp (file)
Quote from Window 1
constant.lisp (file)
Quote from Window 2
constant.lisp (file)
Quote from Window 3
constant.lisp (file)
Quote from Window 4
constant.lisp (file)
Quote from Window 5
constant.lisp (file)
Quote from Window 6
constant.lisp (file)
Quote from Window 7
constant.lisp (file)
Quote Unicode
constant.lisp (file)
constant.lisp (file)
Change to Window 0
constant.lisp (file)
Change to Window 1
constant.lisp (file)
Change to Window 2
constant.lisp (file)
Change to Window 3
constant.lisp (file)
Change to Window 4
constant.lisp (file)
Change to Window 5
constant.lisp (file)
Change to Window 6
constant.lisp (file)
Change to Window 7
constant.lisp (file)
Define Window 0
constant.lisp (file)
Define Window 1
constant.lisp (file)
Define Window 2
constant.lisp (file)
Define Window 3
constant.lisp (file)
Define Window 4
constant.lisp (file)
Define Window 5
constant.lisp (file)
Define Window 6
constant.lisp (file)
Define Window 7
constant.lisp (file)
Define Extended
constant.lisp (file)
Quote Unicode
constant.lisp (file)
The number of static or dynamic windows.
constant.lisp (file)
Next: Internal macros, Previous: Internal constants, Up: Internal definitions [Contents][Index]
If set to T, outputs tag or character informations seen by the decoder to *trace-output*
Next: Internal functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
constant.lisp (file)
Next: Internal generic functions, Previous: Internal macros, Up: Internal definitions [Contents][Index]
constant.lisp (file)
constant.lisp (file)
constant.lisp (file)
constant.lisp (file)
constant.lisp (file)
constant.lisp (file)
constant.lisp (file)
constant.lisp (file)
constant.lisp (file)
constant.lisp (file)
constant.lisp (file)
constant.lisp (file)
constant.lisp (file)
constant.lisp (file)
Next: Internal types, Previous: Internal functions, Up: Internal definitions [Contents][Index]
constant.lisp (file)
constant.lisp (file)
constant.lisp (file)
Previous: Internal generic functions, Up: Internal definitions [Contents][Index]
constant.lisp (file)
constant.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F L M |
---|
Jump to: | C F L M |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | (
1
A D E F G I L M S U W |
---|
Jump to: | (
1
A D E F G I L M S U W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
+
A C D F M P S T |
---|
Jump to: | *
+
A C D F M P S T |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C P R S T U W |
---|
Jump to: | C P R S T U W |
---|