Module:Unicode data/doc: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
Created page with "<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) --> {{#ifeq: {{SUBPAGENAME}} | sandbox | {{#i..."
 
SockyPaws (talk | contribs)
Comment out Lua documentation function
Tag: 2017 source edit
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
<!-- Please place categories where indicated at the bottom of this page. Thank you. -->
{{#ifeq: {{SUBPAGENAME}} | sandbox
{{#ifeq:{{SUBPAGENAME}}|sandbox|{{#invoke:Unicode_data/testcases|run_tests}}}}
  | {{#invoke: Unicode_data/testcases | run_tests}}
{{Documentation subpage}}
  | {{high risk|952513}}
  }}


== Usage ==
== Usage ==
This module provides functions that access information on Unicode code points. The information is retrieved from data modules generated from the [https://www.unicode.org/Public/UNIDATA/ Unicode Character Database], or derived by rules given in the [https://www.unicode.org/versions/Unicode11.0.0/UnicodeStandard-11.0.pdf Unicode Specification]. It and its submodules were copied from English Wiktionary and then modified; see [[wikt:Module:Unicode data|there]] for more information.
This module provides functions that access information on Unicode code points. The information is retrieved from data modules generated from the [https://www.unicode.org/Public/UCD/latest/ Unicode Character Database], or derived by rules given in the [https://www.unicode.org/versions/Unicode16.0.0/ Unicode Specification]. It and its submodules were copied from English Wiktionary and then modified; see [[wiktionary:Module:Unicode data|Module:Unicode data]] for more information.


==Functions==
== Functions ==
; {{code|lang=lua|lookup_name(codepoint)}}
; {{Code|lookup_name(codepoint)}}
: Receives a codepoint (number) and returns its name or label; for example, {{code|lang=lua|lookup_name(0xA9)}} returns {{code|lang=lua|"COPYRIGHT SIGN"}}.
: Receives a codepoint (number) and returns its name or label; for example, {{Code|lookup_name(0xA9)}} returns {{Code|"COPYRIGHT SIGN"}}.
; {{code|lang=lua|lookup, is}}
; {{Code|lookup, is}}
: Template-invokable functions that allow access to the functions starting with <code>lookup</code> and <code>is</code>. Replace the first underscore in the function name with a pipe, and add the codepoint in hexadecimal base, or a bit of text, for <code>is_Latin</code>, <code>is_rtl</code>, and <code>is_valid_pagename</code>, as the next parameter. For example, {{tnull|&#35;invoke:Unicode data|lookup|name|61}} &rarr; {{#invoke:Unicode data|lookup|name|61}}; {{tnull|&#35;invoke:Unicode data|is|Latin|àzàhàr̃iyyā̀}} &rarr; {{#invoke:Unicode data|is|Latin|àzàhàr̃iyyā̀}}.
: Template-invokable functions that allow access to the functions starting with {{Code|lookup}} and {{Code|is}}. Replace the first underscore in the function name with a pipe, and add the codepoint in hexadecimal base, or a bit of text, for {{Code|is_Latin}}, {{Code|is_rtl}}, and {{Code|is_valid_pagename}}, as the next parameter. For example, {{Tnull|&#35;invoke:Unicode data|lookup|name|61}} &rarr; {{Code|<nowiki>{{#invoke:Unicode data|lookup|name|61}}</nowiki>}}; {{Tnull|&#35;invoke:Unicode data|is|Latin|àzàhàr̃iyyā̀}} &rarr; {{Code|<nowiki>{{#invoke:Unicode data|is|Latin|àzàhàr̃iyyā̀}}</nowiki>}}.


==Data modules==
== Data modules ==
The data used by functions in this module is found in [[Special:PrefixIndex/Module:Unicode data/|submodules]]. Some are generated by [[AWK]] scripts shown at [[wikt:User:Kephir/Unicode|User:Kephir/Unicode]] on English Wiktionary, others by Lua scripts on the <code>/make</code> subpages of the submodules.
The data used by functions in this module is found in [[Special:PrefixIndex/Module:Unicode data/|submodules]]. Some are generated by [[wikipedia:Awk|Awk]] scripts shown at [[wiktionary:User:Kephir/Unicode|User:Kephir/Unicode]] on English Wiktionary, others by Lua scripts on the {{Code|/make}} subpages of the submodules.
* [[Module:Unicode data/aliases]]: the formal name aliases for characters (from [https://www.unicode.org/Public/UNIDATA/NameAliases.txt NameAliases.txt])
* [[Module:Unicode data/aliases]]: the formal name aliases for characters (from [https://www.unicode.org/Public/16.0.0/ucd/NameAliases.txt NameAliases.txt])
* [[Module:Unicode data/blocks]]: the list of Unicode blocks (from [https://www.unicode.org/Public/UNIDATA/Blocks.txt Blocks.txt])
* [[Module:Unicode data/blocks]]: the list of Unicode blocks (from [https://www.unicode.org/Public/16.0.0/ucd/Blocks.txt Blocks.txt])
* [[Module:Unicode data/category]]: data mapping characters to their General Category (from [https://www.unicode.org/Public/UNIDATA/extracted/DerivedGeneralCategory.txt DerivedGeneralCategory.txt])
* [[Module:Unicode data/category]]: data mapping characters to their General Category (from [https://www.unicode.org/Public/16.0.0/ucd/extracted/DerivedGeneralCategory.txt DerivedGeneralCategory.txt])
* [[Module:Unicode data/control]]: data for identifying characters that belong to the General Categories of Separator and Other (from [https://www.unicode.org/Public/UNIDATA/extracted/DerivedGeneralCategory.txt DerivedGeneralCategory.txt])
* [[Module:Unicode data/control]]: data for identifying characters that belong to the General Categories of Separator and Other (from [https://www.unicode.org/Public/16.0.0/ucd/extracted/DerivedGeneralCategory.txt DerivedGeneralCategory.txt])
* [[Module:Unicode data/combining]]: data mapping characters to their Combining Classes (from [https://www.unicode.org/Public/UNIDATA/extracted/DerivedCombiningClass.txt DerivedCombiningClass.txt])
* [[Module:Unicode data/combining]]: data mapping characters to their Combining Classes (from [https://www.unicode.org/Public/16.0.0/ucd/extracted/DerivedCombiningClass.txt DerivedCombiningClass.txt])
* [[Module:Unicode data/Hangul]]: data used to generate the names of [[Hangul]] syllables (from [https://www.unicode.org/Public/UNIDATA/Jamo.txt Jamo.txt])
* [[Module:Unicode data/Hangul]]: data used to generate the names of [[Hangul]] syllables (from [https://www.unicode.org/Public/16.0.0/ucd/Jamo.txt Jamo.txt])
* [[Module:Unicode data/scripts]]: data mapping characters to their Unicode script properties (from [https://www.unicode.org/Public/UNIDATA/Scripts.txt Scripts.txt]).
* [[Module:Unicode data/scripts]]: data mapping characters to their Unicode script properties (from [https://www.unicode.org/Public/16.0.0/ucd/Scripts.txt Scripts.txt]).


The name data modules ([[Special:PrefixIndex/Module:Unicode data/names/|Module:Unicode data/names/<var>xxx</var>]]) were compiled from [https://www.unicode.org/Public/UNIDATA/UnicodeData.txt UnicodeData.txt]. Each one contains, at maximum, code points U+xxx000 to U+xxxFFF.
The name data modules ([[Special:PrefixIndex/Module:Unicode data/names/|Module:Unicode data/names/{{Var|xxx}}]]) were compiled from [https://www.unicode.org/Public/16.0.0/ucd/UnicodeData.txt UnicodeData.txt]. Each one contains, at maximum, code points U+xxx000 to U+xxxFFF.
{{#invoke:Unicode data/documentation functions|show_modules}}
<!-- {{#invoke:Unicode data/documentation functions|show_modules}} Disabled for making too many expensive parser function calls. -->


==Copyright==
== Copyright ==
The Unicode database is released by Unicode Inc. under the following terms:
The Unicode database is released by Unicode Inc. under the following terms:


<blockquote>
<blockquote>
Copyright © 1991-2018 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
Copyright © 1991-2024 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in https://www.unicode.org/copyright.html.


Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that either (a) this copyright and permission notice appear with all copies of the Data Files or Software, or (b) this copyright and permission notice appear in associated Documentation.
Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that either (a) this copyright and permission notice appear with all copies of the Data Files or Software, or (b) this copyright and permission notice appear in associated Documentation.
Line 38: Line 36:


Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder.
Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder.
</blockquote>
</blockquote><includeonly>
 
{{#ifeq:{{SUBPAGENAME}}|sandbox||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please. Thank you. -->
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Lua metamodules]]
[[Category:Lua metamodules]]
}}</includeonly>
}}</includeonly>

Latest revision as of 04:52, 22 November 2024


Usage

This module provides functions that access information on Unicode code points. The information is retrieved from data modules generated from the Unicode Character Database, or derived by rules given in the Unicode Specification. It and its submodules were copied from English Wiktionary and then modified; see Module:Unicode data for more information.

Functions

lookup_name(codepoint)
Receives a codepoint (number) and returns its name or label; for example, lookup_name(0xA9) returns "COPYRIGHT SIGN".
lookup, is
Template-invokable functions that allow access to the functions starting with lookup and is. Replace the first underscore in the function name with a pipe, and add the codepoint in hexadecimal base, or a bit of text, for is_Latin, is_rtl, and is_valid_pagename, as the next parameter. For example, {{#invoke:Unicode data|lookup|name|61}}{{#invoke:Unicode data|lookup|name|61}}; {{#invoke:Unicode data|is|Latin|àzàhàr̃iyyā̀}}{{#invoke:Unicode data|is|Latin|àzàhàr̃iyyā̀}}.

Data modules

The data used by functions in this module is found in submodules. Some are generated by Awk scripts shown at User:Kephir/Unicode on English Wiktionary, others by Lua scripts on the /make subpages of the submodules.

The name data modules (Module:Unicode data/names/xxx) were compiled from UnicodeData.txt. Each one contains, at maximum, code points U+xxx000 to U+xxxFFF.

Copyright

The Unicode database is released by Unicode Inc. under the following terms:

Copyright © 1991-2024 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in https://www.unicode.org/copyright.html.

Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that either (a) this copyright and permission notice appear with all copies of the Data Files or Software, or (b) this copyright and permission notice appear in associated Documentation.

THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.

Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder.