Initial commit
This commit is contained in:
commit
65e0da7e11
1397 changed files with 596542 additions and 0 deletions
15
site/OFF_plugins/typography/CHANGELOG.md
Normal file
15
site/OFF_plugins/typography/CHANGELOG.md
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Kirby-Typography Changelog
|
||||
|
||||
- `1.0.0-beta1`
|
||||
- Updated wp-Typography library to version 3.3.0
|
||||
- **Breaking change:** Rename `typography.class.fraction.nominator` option to `typography.class.fraction.numerator` and changed according CSS.
|
||||
- **Breaking change:** Rename `typography.class.ordinal.suffix` option to `typography.class.ordinal`.
|
||||
- Hangin puncutation is no longer applied to guillemets.
|
||||
- `1.0.0-alpha2`
|
||||
- Re-organize folder structure to prepare for usage of unmodified `PHP_Typography` library in the future.
|
||||
- Add `typography.debug` setting to turn off caching
|
||||
- Make panel widget translatable
|
||||
- Change some defaults
|
||||
- Rename configuration values of `typography.dashes.style` to `'em'` and `'en'`
|
||||
- `1.0.0-alpha`
|
||||
- First public release
|
||||
674
site/OFF_plugins/typography/LICENSE
Normal file
674
site/OFF_plugins/typography/LICENSE
Normal file
|
|
@ -0,0 +1,674 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
293
site/OFF_plugins/typography/README.md
Normal file
293
site/OFF_plugins/typography/README.md
Normal file
|
|
@ -0,0 +1,293 @@
|
|||
# Kirby-Typography
|
||||
|
||||
This is a port of [wp-Typography](https://de.wordpress.org/plugins/wp-typography/) for Kirby CMS. Based on the `PHP_Typography` class, this plugin enhances the typography of you kirby-powered website. Think of it a more advanced alternative to the built-in `SmartyPants` parser.
|
||||
|
||||
Current version: `1.0.0-beta1`
|
||||
|
||||
***
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
**Table of Contents**
|
||||
|
||||
- [1 Key Features](#1-key-features)
|
||||
- [2 Download and Installation](#2-download-and-installation)
|
||||
- [2.1 Requirements](#21-requirements)
|
||||
- [2.2 Kirby CLI](#22-kirby-cli)
|
||||
- [2.3 Git Submodule](#23-git-submodule)
|
||||
- [2.4 Copy and Paste](#24-copy-and-paste)
|
||||
- [3 Usage](#3-usage)
|
||||
- [3.1 CSS and JavaScript Setup](#31-css-and-javascript-setup)
|
||||
- [4 Configuration](#4-configuration)
|
||||
- [4.1 Localization for Multilingual Sites](#41-localization-for-multilingual-sites)
|
||||
- [4.2 General Options](#42-general-options)
|
||||
- [4.3 Smart Quotes](#43-smart-quotes)
|
||||
- [4.4 Smart Character Replacements](#44-smart-character-replacements)
|
||||
- [4.5 Smart Spacing](#45-smart-spacing)
|
||||
- [4.6 Character Styling and Hanging Punctuation](#46-character-styling-and-hanging-punctuation)
|
||||
- [4.7 Hyphenation](#47-hyphenation)
|
||||
- [4.8 CSS Classes](#48-css-classes)
|
||||
- [5 Recommended Settings for Different Languages](#5-recommended-settings-for-different-languages)
|
||||
- [6 License](#6-license)
|
||||
- [7 Credits](#7-credits)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
***
|
||||
|
||||
## 1 Key Features
|
||||
|
||||
- **Hyphenation:** Hyphenate text, very handy for justified text or languages with very long words, but also for English. Supports a large number of languages and offers fine-grained control over hyphenation.
|
||||
- **Smart Replacements:** Includes Smart quotes (i.e. „Curly Quotes“, «Guillemets», »Chevrons« or German „Gänsefüßchen“) and smart ordinal suffixes.
|
||||
- **CSS Hooks:** Add `<span class="[…]">` tags around characters like ampersands, CAPITALIZED WORDS etc.
|
||||
- **Hanging Punctuation:** Add the twinkle of the print-era to your site.
|
||||
- **Wraps URLs:** Prevents long URLs from overflowing their container element on small screens.
|
||||
- **Smart Math:** Converts mathematical symbols into their correct counterpart. E.g. `(2x6)/3=4` becomes `(2×6)÷3=4`.
|
||||
- **Caching:** Processing text like this plugin does is a very performance-hungry task. So the results are always cached, even if Kirby’s cache option is turned off. Cache will automatically be updated, if you change your content or update the plugin. It also comes with a *Dashboard Widget*, so you can flush the cache from your panel.
|
||||
|
||||
… and basically every other feature of wp-Typography :-)
|
||||
|
||||
## 2 Download and Installation
|
||||
|
||||
### 2.1 Requirements
|
||||
|
||||
- PHP 5.4.0+ with multibyte extension (mbstring)
|
||||
- Kirby 2.3.0+
|
||||
|
||||
### 2.2 Kirby CLI
|
||||
|
||||
If you’re using the [Kirby CLI](https://github.com/getkirby/cli), you need to `cd` to the root directory of your Kirby installation and run the following command:
|
||||
|
||||
```
|
||||
kirby plugin:install fabianmichael/kirby-typography
|
||||
```
|
||||
|
||||
This will download and copy *Kirby-Typography* into `site/plugins/typography`.
|
||||
|
||||
### 2.3 Git Submodule
|
||||
|
||||
To install this plugin as a git submodule, execute the following command from the root of your kirby project:
|
||||
|
||||
```
|
||||
$ git submodule add https://github.com/fabianmichael/kirby-typography.git site/plugins/typography
|
||||
```
|
||||
|
||||
### 2.4 Copy and Paste
|
||||
|
||||
1. [Download](https://github.com/fabianmichael/kirby-typography/archive/master.zip) the contents of this repository as ZIP-file.
|
||||
2. Rename the extracted folder to `typography` and copy it into the `site/plugins/` directory in your Kirby project.
|
||||
|
||||
## 3 Usage
|
||||
|
||||
The plugin is enabled by default and replaces the [SmartyPants](https://michelf.ca/projects/php-smartypants/) parser of your Kirby installation. That means, typographic enhancements are applied to *Kirbytext* by default.
|
||||
|
||||
I tried to setup *sane* defaults, but you might have different requirements for your site. You can change any of the plugin’s settings in your `config.php` file.
|
||||
|
||||
### 3.1 CSS and JavaScript Setup
|
||||
|
||||
**CSS:** Not all features of the plugin need extra CSS rules, but for stuff like hanging punctuation, and character styling to work properly, it is recommended or even necessary to add the plugin’s CSS file to your site.
|
||||
Add `<?= css('assets/plugins/typography/css/typography.css') ?>` to your template or – even better – copy the rules to your own stylesheet. Note, that some features like hanging punctuation should be tuned in accordance to the font you have chosen.
|
||||
|
||||
**JavaScript:** Hyphenation works by inserting invisible so-called »shy hyphens« (`­`) into works, telling the browser where a word may be hyphenated. Unfortunately, these invisible characters stay in the text, when it is copied from your site. To keep copied text easily editable, it is recommended (though not mandatory) to also include the supplied JavaScript file to your code. Just add `<?= js('assets/plugins/typography/js/dist/copyfix.min.js') ?>` into to your template.
|
||||
|
||||
## 4 Configuration
|
||||
|
||||
You can find a description of all available configuration options below. Customization works just like with any other configuration of Kirby. Your can read more about configuration in the [Kirby docs](https://getkirby.com/docs/developer-guide/configuration/options). The default settings of this plugin were chosen for *United States (US) English*.
|
||||
|
||||
### 4.1 Localization for Multilingual Sites
|
||||
|
||||
If your Kirby installation is configured for multiple languages, you might want to use different settings for every language. In this case, you can define a common baseline of settings – shared by all languages – in your config file. Use the language files in `site/languages/` to define localized versions of your settings. Note, that in the language files, settings need to be configured with `l::set()`, because those localizations are treated as language variables:
|
||||
|
||||
```php
|
||||
# site/config/config.php
|
||||
c::set('typography.class.ampersand', 'ch-amp'); // CSS classes are most likely shared across languages
|
||||
```
|
||||
|
||||
```php
|
||||
# site/languages/fr.php
|
||||
l::set('typography.quotes.primary', 'doubleGuillemetsFrench'); // Quote styles are language-specific …
|
||||
l::set('typography.quotes.secondary', 'doubleCurled');
|
||||
l::set('typography.hyphenation.language', 'fr'); // … and so are hyphenation rules
|
||||
|
||||
# site/languages/de.php
|
||||
l::set('typography.quotes.primary', 'doubleLow9Reversed');
|
||||
l::set('typography.quotes.secondary', 'singleLow9Reversed');
|
||||
l::set('typography.hyphenation.language', 'de');
|
||||
```
|
||||
|
||||
At the end of this document, you can find a [list of recommended settings for different languages](#5-recommended-settings-for-different-languages), you can use as a starting point for your own configuration.
|
||||
|
||||
### 4.2 General Options
|
||||
|
||||
| Option | Default value | Description |
|
||||
|:--------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------|
|
||||
| typography | `true` | Set to `false` to disable plugin functionality. |
|
||||
| typography.debug | `false` | set to `true` to disable the built-in caching mechanism. |
|
||||
| typography.widget | `true` | Set to `false` to disable the dashboard widget. |
|
||||
| typography.ignore.tags | `['code', 'head', 'kbd', 'object', 'option', 'pre', 'samp', 'script', 'noscript', 'noembed', 'select', 'style', 'textarea', 'title', 'var', 'math']` | Defines elements to be ignored by their tag name. |
|
||||
| typography.ignore.classes | `['vcard', 'typography--off']` | Defines elements to be ignored by their class. |
|
||||
| typography.ignore.ids | `[]` | Defines elements to be ignored by their ID. |
|
||||
|
||||
### 4.3 Smart Quotes
|
||||
|
||||
| Option | Default value | Description |
|
||||
|:----------------------------|:-----------------|:---------------------------------------------------------------------------|
|
||||
| typography.quotes | `true` | Transform straight quotes [ \' \" ] to typographically correct characters. |
|
||||
| typography.quotes.primary | `'doubleCurled'` | Primary quotes style. |
|
||||
| typography.quotes.secondary | `'singleCurled'` | Secondary quotes style (for nested quotations). |
|
||||
|
||||
**Available Styles for Smart Quotes:**
|
||||
|
||||
| Option value | Example |
|
||||
|:-----------------------------|:------------------------------|
|
||||
| `'doubleCurled'` *(default)* | “foo” |
|
||||
| `'doubleCurledReversed'` | ”foo” |
|
||||
| `'doubleLow9'` | „foo” |
|
||||
| `'doubleLow9Reversed'` | „foo“ |
|
||||
| `'singleCurled'` *(default)* | ‘foo’ |
|
||||
| `'singleCurledReversed'` | ’foo’ |
|
||||
| `'singleLow9'` | ‚foo’ |
|
||||
| `'singleLow9Reversed'` | ‚foo‘ |
|
||||
| `'doubleGuillemetsFrench'` | « foo » |
|
||||
| `'doubleGuillemets'` | «foo» |
|
||||
| `'doubleGuillemetsReversed'` | »foo« |
|
||||
| `'singleGuillemets'` | ‹foo› |
|
||||
| `'singleGuillemetsReversed'` | ›foo‹ |
|
||||
| `'cornerBrackets'` | 「foo」 |
|
||||
| `'whiteCornerBracket'` | 『foo』 |
|
||||
|
||||
### 4.4 Smart Character Replacements
|
||||
|
||||
| Option | Default value | Description |
|
||||
|:-------------------------------|:------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| typography.dashes | `true` | Transform minus-hyphens [ \- \-\- ] to contextually appropriate dashes, minus signs, and hyphens [ – — − ‐ ]. |
|
||||
| typography.dashes.style | `'em'` | Sets the style of smart dashes. Alternative value: `'em'`.<sup>1</sup> |
|
||||
| typography.dashes.spacing | `true` | Force thin spaces between em & en dashes and adjoining words. |
|
||||
| typography.diacritics | `false` | Force diacritics where appropriate *(i.e. creme brulee becomes crème brûlée)*. |
|
||||
| typography.diacritics.language | `en-US` | Language for diacritic replacements. Language definitions will purposefully **not** process words that have alternate meaning without diacritics like *resume* & *résumé*, *divorce* & *divorcé*, and *expose* & *exposé*. Currently available options are only `'en-US'` and `'de-DE'`. |
|
||||
| typography.diacritics.custom | `[]` | Custom diacritic word replacements: Takes an associative array with the searches as keys and the replacements as values. Note, that this is case-sensitive. |
|
||||
| typography.ellipses | `true` | Transform three periods [ \.\.\. ] to ellipses [ … ]. |
|
||||
| typography.marks | `true` | Transform registration marks [ (c) (r) (tm) (sm) (p) ] to proper characters [ © ® ™ ℠ ℗ ]. |
|
||||
| typography.ordinal.suffix | `true` | Transform ordinal suffixes [ 1st ] to pretty ordinals [ 1<sup>st</sup> ]. |
|
||||
| typography.math | `true` | Transforms math symbols [ (2x6)/3=4 ] to correct symbols [ (2×6)÷3=4 ]. |
|
||||
| typography.fractions | `true` | Transform fractions [ 1/2 ] to pretty fractions [ <sup>1</sup>⁄<sub>2</sub> ]. |
|
||||
| typography.exponents | `true` | Transform exponents [ 3\^2 ] to pretty exponents [ 3<sup>2</sup> ]. |
|
||||
|
||||
<small>1) In the US, the em dash — with no or very little spacing — is used for parenthetical expressions, while internationally, the en dash – with spaces – is more prevalent.</small>
|
||||
|
||||
<small>2) Some fonts support smart fractions via an OpenType feature called “[frac](https://helpx.adobe.com/de/typekit/using/open-type-syntax.html#frac)”, but is has to be enabled manually by declaring the `font-feature-settings` property in CSS. As of 2016, this is not supported by all major browsers. If you need this to work in everywhere, you should not rely on the OpenType feature and leave this setting turned on. The only exception where you really should disable this feature are monospaced fonts, because using smaller digits will break the fixed-width grid, your letters are sitting on. Details on browser support for the `frac` feature can be found at [The State of Web Type](http://stateofwebtype.com/#Fractions%20%28frac%29) and [Can I use](http://caniuse.com/#feat=font-feature).</small>
|
||||
|
||||
### 4.5 Smart Spacing
|
||||
|
||||
| Option | Default value | Description |
|
||||
|:---------------------------------------|:-------------------------------------------------------|:------------|
|
||||
| typography.wordspacing.singlecharacter | `true` | Enable forcing single character words to next line with the insertion of ` ` (no-break space). |
|
||||
| typography.fraction.spacing | `true` | Inserts a no-break space into fractions to prevent wrapping [ 5 <sup>1</sup>⁄<sub>2</sub> ]. |
|
||||
| typography.punctuation.spacing.french | `false` | Enable extra whitespace before certain punctuation marks, as is the French custom. |
|
||||
| typography.units.spacing | `true` | Keep values and units together [ 12 cm ]. |
|
||||
| typography.units.custom | `[]` | Additional units to match (*Kirby-Typography* already recognizes a with a large amount of different units). |
|
||||
| typography.dewidow | `true` | Prevent widows. |
|
||||
| typography.dewidow.maxlength | `5` | Only protect widows with `x` or fewer letters. |
|
||||
| typography.dewidow.maxpull | `5` | Pull at most `x` letters from the previous line to keep the widow company. |
|
||||
| typography.wrap.hardhyphens | `true` | Enable wrapping after hard hyphens. Adds zero-width spaces after hard hyphens (like in “zero-width”). |
|
||||
| typography.wrap.url | `true` | Enable wrapping of long URLs. Adds zero-width spaces throughout the URL. |
|
||||
| typography.wrap.email | `true` | Enable wrapping of long emails. Adds zero-width spaces throughout the email. |
|
||||
| typography.wrap.url.minafter | `5` | Keep at least the last `x` characters of a URL together. |
|
||||
| typography.domains.custom | `['local', 'onion', 'exit', 'tor', 'test', 'example']` | The parser looks for domains in your content, based on a list of all valid Top-Level-Domains (updated and cached automatically once a week). Use this option to define additional domains, the parser should look for. |
|
||||
| typography.space.collapse | `true` | Remove superfluous whitespace from your content. |
|
||||
| typography.space.nobreak.narrow | `false` | Enable to use true no-break narrow space ([U+202F](http://decodeunicode.org/en/u+202F)) instead of regular no-break space (` `). Disabled by default, because this glyph is missing in most fonts. Make sure, that your |
|
||||
|
||||
### 4.6 Character Styling and Hanging Punctuation
|
||||
|
||||
The following options add `<span>` tags around certain parts of your content to create *CSS hooks*, allowing you to style specific parts of your text.
|
||||
|
||||
| Option | Default value | Description |
|
||||
|:-------------------------------------|:----------------------------------------------------------------------------|:------------------------------------------------------------------------------------|
|
||||
| typography.style.ampersands | `false` | Wrap ampersands [ & ] with a `<span>` tag. |
|
||||
| typography.style.caps | `true` | Wrap words in ALL CAPS with a `<span>` tag. |
|
||||
| typography.style.numbers | `false` | Wrap numbers with a `<span>` tag. |
|
||||
| typography.style.punctuation.hanging | `false` | Enable hanging punctuation. Also see the included stylesheet to see how this works. |
|
||||
| typography.style.quotes.initial | `true` | Wrap initial quotes with a `<span>` tag. |
|
||||
| typography.style.quotes.initial.tags | `['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'li', 'dd', 'dt']` | Only style initial quotes within these tags. |
|
||||
|
||||
### 4.7 Hyphenation
|
||||
|
||||
| Option | Default value | Description |
|
||||
|:----------------------------------|:--------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| typography.hyphenation | `true` | Enables hyphenation. |
|
||||
| typography.hyphenation.language | `'en-US'` | Sets the language for hyphenation rules.<sup>3</sup> |
|
||||
| typography.hyphenation.minlength | `7` | Do not hyphenate words with less than `x` letters. |
|
||||
| typography.hyphenation.minbefore | `3` | Number of letters to keep before hyphenation. |
|
||||
| typography.hyphenation.minafter | `2` | Number of letters to keep after hyphenation. |
|
||||
| typography.hyphenation.headings | `true` | Disabling this option will disallow hyphenation of headings, even if allowed in the general scope. |
|
||||
| typography.hyphenation.allcaps | `true` | Hyphenate words in ALL CAPS. |
|
||||
| typography.hyphenation.titlecase | `true` | Allow hyphenation of words that begin with a capital letter. Disable to avoid hyphenation of proper nouns. |
|
||||
| typography.hyphenation.compounds | `true` | Allow hyphenation of the components of hyphenated compound words. Disable to disallow the hyphenation of the words making up a hyphenated compound *(e.g. editor-in-chief)*. |
|
||||
| typography.hyphenation.exceptions | `[]` | Exception List (array): Mark allowed hyphenations with "-" (e.g. typo-graphy). |
|
||||
|
||||
<small>3) Hyphenation rules are available for the following languages: `af`, `hy`, `eu`, `bg`, `ca`, `zh-Latn`, `hr`, `cs`, `da`, `nl`, `en-GB`, `en-US`, `et`, `fi`, `fr`, `gl`, `ka`, `de`, `de-1901`, `grc`, `el-Mono`, `el-Poly`, `hu`, `is`, `id`, `ia`, `ga`, `it`, `la`, `la-classic`, `lv`, `lt`, `mn-Cyrl`, `no`, `pl`, `pt`, `ro`, `ru`, `sa`, `sr-Cyrl`, `sh-Cyrl`, `sh-Latn`, `sk`, `sl`, `es`, `sv`, `th`, `tr`, `tk`, `uk`, `cy`</small>
|
||||
|
||||
### 4.8 CSS Classes
|
||||
|
||||
Some of the options above add `<span>` tags around single characters or sequences of characters, so you hook into their presentation via good ol’ CSS. If you don’t like the rather long class names I have chosen as default, feel free to change ’em to whatever you like by settings the options below:
|
||||
|
||||
| Option | Default value |
|
||||
|:--------------------------------------|:-----------------------------|
|
||||
| typography.class.ampersand | `'char--ampersand'` |
|
||||
| typography.class.caps | `'char--caps'` |
|
||||
| typography.class.numbers | `'char--numbers'` |
|
||||
| typography.class.fraction.numerator | `'frac--numerator'` |
|
||||
| typography.class.fraction.denominator | `'frac--denominator'` |
|
||||
| typography.class.quote.initial.single | `'char--singleQuoteInitial'` |
|
||||
| typography.class.quote.initial.double | `'char--doubleQuoteInitial'` |
|
||||
| typography.class.push.single | `'push--singleQuote'` |
|
||||
| typography.class.push.double | `'push--doubleQuote'` |
|
||||
| typography.class.pull.single | `'pull--singleQuote'` |
|
||||
| typography.class.pull.double | `'pull--doubleQuote'` |
|
||||
| typography.class.ordinal.suffix | `'char--ordinalSuffix'` |
|
||||
|
||||
|
||||
## 5 Recommended Settings for Different Languages
|
||||
|
||||
The following recommendations are based on common typographic conventions of those languages. That does not mean, that you have to stick to them, but their make a good starting point for your own settings. Is your language missing in this list? Feel free to [create an issue](https://github.com/fabianmichael/kirby-typography/issues/new) or pull request and I will add settings for your language to the list.
|
||||
|
||||
**Important:** If your site is multilingual, you need to define those settings in `site/languages/[language code].php`, using `l::set()` instead of `c::set`, if you want to use different settings per language.
|
||||
|
||||
**French (France):**
|
||||
|
||||
```php
|
||||
c::set([
|
||||
'typography.punctuation.spacing.french' => true,
|
||||
'typography.dashes.style' => 'em', // cadratin ('en' for demi-cadratin)
|
||||
'typography.quotes.primary' => 'doubleGuillemetsFrench',
|
||||
'typography.quotes.secondary' => 'doubleCurled',
|
||||
'typography.hyphenation.language' => 'fr',
|
||||
]);
|
||||
```
|
||||
|
||||
**German (Germany):**
|
||||
|
||||
```php
|
||||
c::set([
|
||||
'typography.dashes.style' => 'en',
|
||||
'typography.quotes.primary' => 'doubleLow9Reversed',
|
||||
'typography.quotes.secondary' => 'singleLow9Reversed',
|
||||
'typography.hyphenation.language' => 'de',
|
||||
]);
|
||||
```
|
||||
Note: In books, sometimes Chevrons [ »foo« ] are used as quotation marks instead. Use `doubleGuillemetsReversed` and `singleGuillemetsReversed` if you prefer that style.
|
||||
|
||||
## 6 License
|
||||
|
||||
*Kirby-Typography* is released under the GNU General Public License 3.0 or later. See `LICENSE` file for details (FYI: This is mandatory, because wp-Typography is also released under GPL. I would have preferred the MIT license.).
|
||||
|
||||
## 7 Credits
|
||||
|
||||
**Kirby-Typography** is developed and maintained by [Fabian Michael](https://fabianmichael.de).
|
||||
|
||||
The plugin includes or is based on the following third-party libraries:
|
||||
|
||||
- **PHP-Typography:** Copyright 2014-2016 Peter Putzer; 2012-2013 Marie Hogebrandt; 2009-2011 KINGdesk, LLC. Released under the [GPL 2.0](http://www.gnu.org/licenses/gpl-2.0.html) or later. Large parts of this documentation have also been copied and/or adapted from the original WordPress plugin.
|
||||
- **HTML5-PHP:** Released under the *HTML5Lib License* (see `vendors/masterminds/HTML5/LICENSE` for details and contributors)
|
||||
- **A List of all Top-Level-Domains**, maintained by the [Internet Assigned Numbers Authority (IANA)](http://www.iana.org) (automatically updated once a week)
|
||||
- **JavaScript** (copyfix.js) based on [Hyphenator](https://github.com/mnater/Hyphenator) 5.2.0(devel). Copyright 2015 by Mathias Nater. Originally released under the MIT license.
|
||||
63
site/OFF_plugins/typography/assets/css/typography.css
Normal file
63
site/OFF_plugins/typography/assets/css/typography.css
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/* =-=-=-=-= NOARMALIZATION =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
|
||||
|
||||
/* Make sure that you have proper styling for subscript and superscript in
|
||||
stylesheet, so it does not affect the line-height of the surrounding text.
|
||||
The following defaults are taken from `Normalize.css` v.4.1.1:
|
||||
https://github.com/necolas/normalize.css/blob/master/normalize.css
|
||||
If you already have those rules in your stylesheet, which deal with that, feel
|
||||
free to remove the following lines from this file. */
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub { bottom: -0.25em; }
|
||||
sup { top: -0.5em; }
|
||||
|
||||
|
||||
/* =-=-=-=-= CHARACTER STYLING =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */
|
||||
|
||||
/* If you really want to use that Baskerville ampersand, no matter if it matches
|
||||
with the other typefaces on your page, please go ahead and uncomment the
|
||||
following lines … */
|
||||
.char--ampersand {
|
||||
/*
|
||||
font-family: Baskerville, "Goudy Old Style", "Palatino", "Book Antiqua", "Warnock Pro", serif;
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
font-size: 1.1em;
|
||||
line-height: 1em;
|
||||
*/
|
||||
}
|
||||
|
||||
/* Words with all CAPITAL LETTERS */
|
||||
.char--caps {
|
||||
letter-spacing: 0.025em;
|
||||
}
|
||||
|
||||
/* Sequences of one or more digits */
|
||||
.char--numbers {
|
||||
/* Add your own rules here, if you need */
|
||||
}
|
||||
|
||||
/* Smart fractions */
|
||||
.frac--numerator { margin-right: .05em; }
|
||||
.frac--denominator { margin-left: .05em; }
|
||||
|
||||
|
||||
/* =-=-=-=-= HANGING PUNCUTATION =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */
|
||||
|
||||
/* Initial Quotes */
|
||||
.char--singleQuoteInitial { margin-left: -0.4em; }
|
||||
.char--doubleQuoteInitial { margin-left: -0.2em; }
|
||||
|
||||
/* Double quote (") marks */
|
||||
.pull--doubleQuote { margin-left: -0.38em; }
|
||||
.push--doubleQuote { margin-right: 0.38em; }
|
||||
|
||||
/* Single quote (') marks */
|
||||
.pull--singleQuote { margin-left: -0.15em; }
|
||||
.push--singleQuote { margin-right: 0.15em; }
|
||||
1
site/OFF_plugins/typography/assets/js/dist/copyfix.min.js
vendored
Normal file
1
site/OFF_plugins/typography/assets/js/dist/copyfix.min.js
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
!function(e,a,t){function n(e){var a,t,o,i=0;switch(d){case"|":a="\\|";break;case"+":a="\\+";break;case"*":a="\\*";break;default:a=d}switch(r){case"|":t="\\|";break;case"+":t="\\+";break;case"*":t="\\*";break;default:t=r}for(o=e.childNodes[i];o;)3===o.nodeType?(o.data=o.data.replace(new RegExp(a,"g"),""),o.data=o.data.replace(new RegExp(t,"g"),"")):1===o.nodeType&&n(o),i+=1,o=e.childNodes[i]}function o(t){t.stopPropagation();var o=(a.body,e.getSelection()),d=o.getRangeAt(0),r=a.createElement("div");r.style.cssText="position: absolute;left: -1000px;width: 900px;overflow: hidden;",a.body.appendChild(r),r.appendChild(d.cloneContents()),n(r),o.selectAllChildren(r),e.setTimeout(function(){r.parentNode.removeChild(r),o.removeAllRanges(),o.addRange(d)},0)}var d=String.fromCharCode(173),r=String.fromCharCode(8203);e.getSelection&&a.addEventListener("copy",o)}(window,document);
|
||||
87
site/OFF_plugins/typography/assets/js/src/copyfix.js
Normal file
87
site/OFF_plugins/typography/assets/js/src/copyfix.js
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
(function (window, document, undefined) {
|
||||
|
||||
// Removal function based on Hyphenator 5.2.0(devel)
|
||||
// Copyright (C) 2015 Mathias Nater, Zürich (mathiasnater at gmail dot com)
|
||||
// https://github.com/mnater/Hyphenator
|
||||
// Released under the MIT license
|
||||
// http://mnater.github.io/Hyphenator/LICENSE.txt
|
||||
|
||||
var hyphen = String.fromCharCode(173),
|
||||
urlhyphen = String.fromCharCode(8203);
|
||||
|
||||
function removeHyphenationFromElement(el) {
|
||||
var h, u, i = 0, n;
|
||||
switch (hyphen) {
|
||||
case '|':
|
||||
h = '\\|';
|
||||
break;
|
||||
case '+':
|
||||
h = '\\+';
|
||||
break;
|
||||
case '*':
|
||||
h = '\\*';
|
||||
break;
|
||||
default:
|
||||
h = hyphen;
|
||||
}
|
||||
switch (urlhyphen) {
|
||||
case '|':
|
||||
u = '\\|';
|
||||
break;
|
||||
case '+':
|
||||
u = '\\+';
|
||||
break;
|
||||
case '*':
|
||||
u = '\\*';
|
||||
break;
|
||||
default:
|
||||
u = urlhyphen;
|
||||
}
|
||||
n = el.childNodes[i];
|
||||
while (!!n) {
|
||||
if (n.nodeType === 3) {
|
||||
n.data = n.data.replace(new RegExp(h, 'g'), '');
|
||||
n.data = n.data.replace(new RegExp(u, 'g'), '');
|
||||
} else if (n.nodeType === 1) {
|
||||
removeHyphenationFromElement(n);
|
||||
}
|
||||
i += 1;
|
||||
n = el.childNodes[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Based on: http://bavotasan.com/2010/add-a-copyright-notice-to-copied-text/
|
||||
function fixBeforeCopy(e) {
|
||||
e.stopPropagation();
|
||||
|
||||
var body_element = document.body,
|
||||
selection = window.getSelection(),
|
||||
range = selection.getRangeAt(0),
|
||||
copytext = selection,
|
||||
dummy = document.createElement('div');
|
||||
|
||||
dummy.style.cssText =
|
||||
'position: absolute;' +
|
||||
'left: -1000px;' +
|
||||
'width: 900px;' +
|
||||
'overflow: hidden;';
|
||||
|
||||
document.body.appendChild(dummy);
|
||||
|
||||
dummy.appendChild(range.cloneContents());
|
||||
|
||||
removeHyphenationFromElement(dummy);
|
||||
selection.selectAllChildren(dummy);
|
||||
|
||||
window.setTimeout(function () {
|
||||
dummy.parentNode.removeChild(dummy);
|
||||
selection.removeAllRanges(); //IE9 needs that
|
||||
selection.addRange(range);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
if (!!window.getSelection) {
|
||||
document.addEventListener("copy", fixBeforeCopy);
|
||||
}
|
||||
|
||||
})(window, document);
|
||||
26
site/OFF_plugins/typography/gulpfile.js
Normal file
26
site/OFF_plugins/typography/gulpfile.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* jshint esversion: 6 */
|
||||
|
||||
const gulp = require('gulp');
|
||||
const uglify = require('gulp-uglify');
|
||||
const rename = require('gulp-rename');
|
||||
const toc = require('gulp-doctoc');
|
||||
|
||||
gulp.task( 'scripts', function () {
|
||||
return gulp.src(['assets/js/src/**/*.js'])
|
||||
.pipe(uglify())
|
||||
.pipe(rename({ suffix: '.min' }))
|
||||
.pipe(gulp.dest('assets/js/dist'));
|
||||
});
|
||||
|
||||
gulp.task( 'readme', function() {
|
||||
return gulp.src(['README.md'])
|
||||
.pipe(toc({
|
||||
mode: "github.com",
|
||||
title: "**Table of Contents**",
|
||||
}))
|
||||
.pipe(gulp.dest('.'));
|
||||
});
|
||||
|
||||
gulp.task('default', [ 'scripts' ]);
|
||||
|
||||
gulp.task('build', [ 'default', 'readme' ]);
|
||||
79
site/OFF_plugins/typography/lib/cache.php
Normal file
79
site/OFF_plugins/typography/lib/cache.php
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of Kirby-Typography. A port of wp-Typography
|
||||
* for Kirby CMS (https://getkirby.com).
|
||||
*
|
||||
* Copyright of Kirby-Typography:
|
||||
* 2016 Fabian Michael.
|
||||
*
|
||||
* Copyright of wp-Typography (included in this package):
|
||||
* 2014-2016 Peter Putzer.
|
||||
* 2012-2013 Marie Hogebrandt.
|
||||
* 2009-2011 KINGdesk, LLC.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package Kirby\Plugings\Typography
|
||||
* @author Fabian Michael <hallo@fabianmichael.de>
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
namespace Kirby\Plugins\Typography;
|
||||
use Cache\Driver\File as FileCache;
|
||||
use Dir;
|
||||
use F;
|
||||
|
||||
class Cache {
|
||||
|
||||
protected $cacheRoot;
|
||||
protected $driver;
|
||||
|
||||
protected function __construct() {
|
||||
$this->cacheRoot = kirby()->roots()->cache() . DS . 'plugins' . DS . 'typography';
|
||||
|
||||
if (!f::exists($this->cacheRoot)) {
|
||||
dir::make($this->cacheRoot);
|
||||
}
|
||||
|
||||
$this->driver = new FileCache($this->cacheRoot);
|
||||
}
|
||||
|
||||
public static function instance() {
|
||||
static $instance;
|
||||
return $instance ?: $instance = new self();
|
||||
}
|
||||
|
||||
public function driver() {
|
||||
return $this->driver;
|
||||
}
|
||||
|
||||
public function root() {
|
||||
return $this->cacheRoot;
|
||||
}
|
||||
|
||||
public function status() {
|
||||
return [
|
||||
'size' => dir::size($this->cacheRoot),
|
||||
'files' => sizeof(dir::read($this->cacheRoot)),
|
||||
];
|
||||
}
|
||||
|
||||
public function __call($name, $arguments) {
|
||||
return call_user_func_array([$this->driver, $name], $arguments);
|
||||
}
|
||||
}
|
||||
215
site/OFF_plugins/typography/lib/component/typography.php
Normal file
215
site/OFF_plugins/typography/lib/component/typography.php
Normal file
|
|
@ -0,0 +1,215 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of Kirby-Typography. A port of wp-Typography
|
||||
* for Kirby CMS (https://getkirby.com).
|
||||
*
|
||||
* Copyright of Kirby-Typography:
|
||||
* 2016 Fabian Michael.
|
||||
*
|
||||
* Copyright of wp-Typography (included in this package):
|
||||
* 2014-2016 Peter Putzer.
|
||||
* 2012-2013 Marie Hogebrandt.
|
||||
* 2009-2011 KINGdesk, LLC.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package Kirby\Plugings\Typography
|
||||
* @author Fabian Michael <hallo@fabianmichael.de>
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
namespace Kirby\Plugins\Typography\Component;
|
||||
use Kirby\Plugins\Typography\KirbyTypography;
|
||||
use Kirby\Plugins\Typography\Cache;
|
||||
use Field;
|
||||
use L;
|
||||
|
||||
class Typography extends \Kirby\Component\Smartypants {
|
||||
|
||||
public $version = '1.0.0-beta1';
|
||||
|
||||
public function defaults() {
|
||||
return [
|
||||
'typography' => true,
|
||||
'typography.debug' => false,
|
||||
|
||||
// general attributes
|
||||
'typography.ignore.tags' => ['code', 'head', 'kbd', 'object',
|
||||
'option', 'pre', 'samp', 'script',
|
||||
'noscript', 'noembed', 'select',
|
||||
'style', 'textarea', 'title',
|
||||
'var', 'math'],
|
||||
'typography.ignore.classes' => [ 'vcard', 'typography--off' ],
|
||||
'typography.ignore.ids' => [],
|
||||
|
||||
// smart characters
|
||||
'typography.quotes' => true,
|
||||
'typography.quotes.primary' => 'doubleCurled',
|
||||
'typography.quotes.secondary' => 'singleCurled',
|
||||
|
||||
'typography.dashes' => true,
|
||||
'typography.dashes.style' => 'em',
|
||||
'typography.dashes.spacing' => true,
|
||||
|
||||
'typography.diacritics' => false,
|
||||
'typography.diacritics.language' => 'en-US',
|
||||
'typography.diacritics.custom' => [],
|
||||
|
||||
'typography.ellipses' => true,
|
||||
'typography.marks' => true,
|
||||
'typography.ordinal.suffix' => true,
|
||||
'typography.math' => true,
|
||||
'typography.fractions' => true,
|
||||
'typography.exponents' => true,
|
||||
|
||||
// smart spacing
|
||||
'typography.wordspacing.singlecharacter' => true,
|
||||
'typography.fraction.spacing' => true,
|
||||
'typography.punctuation.spacing.french' => false,
|
||||
'typography.units.spacing' => true,
|
||||
'typography.units.custom' => [],
|
||||
|
||||
'typography.dewidow' => true,
|
||||
'typography.dewidow.maxlength' => 5,
|
||||
'typography.dewidow.maxpull' => 5,
|
||||
|
||||
'typography.wrap.hardhyphens' => true,
|
||||
'typography.wrap.url' => true,
|
||||
'typography.wrap.email' => true,
|
||||
'typography.wrap.url.minafter' => 5,
|
||||
'typography.domains.custom' => ['local', // local network links
|
||||
'onion', 'exit', 'tor', // TOR Project
|
||||
'test', 'example',
|
||||
],
|
||||
|
||||
'typography.space.collapse' => true,
|
||||
'typography.space.nobreak.narrow' => false,
|
||||
|
||||
// character styling
|
||||
'typography.style.ampersands' => false,
|
||||
'typography.style.caps' => true,
|
||||
'typography.style.numbers' => false,
|
||||
|
||||
// hanging punctuation
|
||||
'typography.style.punctuation.hanging' => true,
|
||||
'typography.style.quotes.initial' => true,
|
||||
'typography.style.quotes.initial.tags' => ['p', 'h1', 'h2', 'h3', 'h4',
|
||||
'h5', 'h6', 'blockquote',
|
||||
'li', 'dd', 'dt'],
|
||||
|
||||
// hyphenation
|
||||
'typography.hyphenation' => true,
|
||||
'typography.hyphenation.language' => 'en-US',
|
||||
'typography.hyphenation.minlength' => 7,
|
||||
'typography.hyphenation.minbefore' => 3,
|
||||
'typography.hyphenation.minafter' => 2,
|
||||
|
||||
'typography.hyphenation.headings' => true,
|
||||
'typography.hyphenation.allcaps' => true,
|
||||
'typography.hyphenation.titlecase' => true,
|
||||
'typography.hyphenation.compounds' => true,
|
||||
'typography.hyphenation.exceptions' => [],
|
||||
|
||||
// css classes
|
||||
'typography.class.ampersand' => 'char--ampersand',
|
||||
'typography.class.caps' => 'char--caps',
|
||||
'typography.class.numbers' => 'char--numbers',
|
||||
'typography.class.fraction.numerator' => 'frac--numerator',
|
||||
'typography.class.fraction.denominator' => 'frac--denominator',
|
||||
|
||||
'typography.class.quote.initial.single' => 'char--singleQuoteInitial',
|
||||
'typography.class.quote.initial.double' => 'char--doubleQuoteInitial',
|
||||
'typography.class.push.single' => 'push--singleQuote',
|
||||
'typography.class.push.double' => 'push--doubleQuote',
|
||||
'typography.class.pull.single' => 'pull--singleQuote',
|
||||
'typography.class.pull.double' => 'pull--doubleQuote',
|
||||
'typography.class.ordinal' => 'char--ordinalSuffix',
|
||||
];
|
||||
}
|
||||
|
||||
protected $settingsSerialized;
|
||||
protected $typo;
|
||||
protected $_localized = false;
|
||||
|
||||
|
||||
protected function hash($text) {
|
||||
if (is_null($this->settingsSerialized)) {
|
||||
$settings = ['typography.version' => $this->version];
|
||||
foreach ($this->defaults() as $key => $val) {
|
||||
$settings[$key] = $this->kirby->options[$key];
|
||||
}
|
||||
$this->settingsSerialized = serialize($settings);
|
||||
}
|
||||
return md5($this->settingsSerialized . $text);
|
||||
}
|
||||
|
||||
|
||||
public function typography() {
|
||||
if (!$this->typo) {
|
||||
$this->typo = new KirbyTypography(false);
|
||||
}
|
||||
return $this->typo;
|
||||
}
|
||||
|
||||
protected function localize() {
|
||||
if ($this->_localized) return; // this method can only be called once
|
||||
|
||||
if ($this->kirby->site->multilang()) {
|
||||
$language = l::get();
|
||||
foreach (array_keys($this->defaults()) as $option) {
|
||||
if (isset($language[$option])) {
|
||||
// override defaults and settings from config file, if localized setting is available
|
||||
$this->kirby->options[$option] = $language[$option];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->_localized = true;
|
||||
}
|
||||
|
||||
protected function processText($text) {
|
||||
$typo = $this->typography();
|
||||
return $typo->process($text);
|
||||
}
|
||||
|
||||
|
||||
public function parse($text, $force = false, Field $field = NULL) {
|
||||
$this->localize(); // cannot use the `configure` method to do this, because it gets executed before languages are loaded
|
||||
|
||||
if (!$this->kirby->option('typography')) {
|
||||
return $text;
|
||||
} else {
|
||||
|
||||
if ($this->kirby->option('typography.debug')) {
|
||||
// Skip caching when in debug mode
|
||||
return $this->processText($text);
|
||||
}
|
||||
|
||||
$cache = Cache::instance();
|
||||
$cacheKey = $this->hash($text);
|
||||
$parsedText = $cache->get($cacheKey, false);
|
||||
|
||||
if ($parsedText === false) {
|
||||
$parsedText = $this->processText($text);
|
||||
$cache->set($cacheKey, $parsedText);
|
||||
}
|
||||
|
||||
return $parsedText;
|
||||
}
|
||||
}
|
||||
}
|
||||
187
site/OFF_plugins/typography/lib/kirbytypography.php
Normal file
187
site/OFF_plugins/typography/lib/kirbytypography.php
Normal file
|
|
@ -0,0 +1,187 @@
|
|||
<?php
|
||||
|
||||
namespace Kirby\Plugins\Typography;
|
||||
use PHP_Typography\PHP_Typography;
|
||||
|
||||
class KirbyTypography extends PHP_Typography {
|
||||
|
||||
protected $domainListUrl = 'http://data.iana.org/TLD/tlds-alpha-by-domain.txt';
|
||||
protected $domainListCacheLifetime = 10080; // one week in minutes
|
||||
|
||||
protected $dashStylesMap = [
|
||||
'en' => 'international',
|
||||
'em' => 'traditionalUS',
|
||||
];
|
||||
|
||||
private $cssClassKeys = [
|
||||
'typography.class.caps' => 'caps',
|
||||
'typography.class.numbers' => 'numbers',
|
||||
'typography.class.ampersand' => 'amp',
|
||||
'typography.class.quote.initial.single' => 'quo',
|
||||
'typography.class.quote.initial.double' => 'dquo',
|
||||
'typography.class.push.single' => 'push-single',
|
||||
'typography.class.push.double' => 'push-double',
|
||||
'typography.class.pull.single' => 'pull-single',
|
||||
'typography.class.pull.double' => 'pull-double',
|
||||
'typography.class.fraction.numerator' => 'numerator',
|
||||
'typography.class.fraction.denominator' => 'denominator',
|
||||
'typography.class.ordinal' => 'ordinal',
|
||||
];
|
||||
|
||||
protected $kirby;
|
||||
|
||||
function __construct($set_defaults = true, $init = 'now') {
|
||||
$this->kirby = kirby();
|
||||
|
||||
// ignore arguments of the constructor
|
||||
parent::__construct(true);
|
||||
$o = $this->kirby->options;
|
||||
|
||||
// general attributes
|
||||
$this->set_tags_to_ignore($o['typography.ignore.tags']);
|
||||
$this->set_classes_to_ignore($o['typography.ignore.classes']);
|
||||
$this->set_ids_to_ignore($o['typography.ignore.ids']);
|
||||
|
||||
// smart characters
|
||||
$this->set_smart_quotes($o['typography.quotes']);
|
||||
$this->set_smart_quotes_primary($o['typography.quotes.primary']);
|
||||
$this->set_smart_quotes_secondary($o['typography.quotes.secondary']);
|
||||
|
||||
$this->set_smart_dashes($o['typography.dashes']);
|
||||
$this->set_smart_dashes_style($o['typography.dashes.style']);
|
||||
$this->set_dash_spacing($o['typography.dashes.spacing']);
|
||||
|
||||
$this->set_smart_diacritics($o['typography.diacritics']);
|
||||
$this->set_diacritic_language($o['typography.diacritics.language']);
|
||||
$this->set_diacritic_custom_replacements($o['typography.diacritics.custom']);
|
||||
|
||||
$this->set_smart_ellipses($o['typography.ellipses']);
|
||||
$this->set_smart_marks($o['typography.marks']);
|
||||
$this->set_smart_ordinal_suffix($o['typography.ordinal.suffix']);
|
||||
$this->set_smart_math($o['typography.math']);
|
||||
$this->set_smart_fractions($o['typography.fractions']);
|
||||
$this->set_smart_exponents($o['typography.exponents']);
|
||||
|
||||
// smart spacing
|
||||
$this->set_single_character_word_spacing($o['typography.wordspacing.singlecharacter']);
|
||||
$this->set_fraction_spacing($o['typography.fraction.spacing']);
|
||||
$this->set_french_punctuation_spacing($o['typography.punctuation.spacing.french']);
|
||||
$this->set_unit_spacing($o['typography.units.spacing']);
|
||||
$this->set_units($o['typography.units.custom']);
|
||||
|
||||
$this->set_dewidow($o['typography.dewidow']);
|
||||
$this->set_max_dewidow_length($o['typography.dewidow.maxlength']);
|
||||
$this->set_max_dewidow_pull($o['typography.dewidow.maxpull']);
|
||||
|
||||
$this->set_wrap_hard_hyphens($o['typography.wrap.hardhyphens']);
|
||||
$this->set_url_wrap($o['typography.wrap.url']);
|
||||
$this->set_email_wrap($o['typography.wrap.email']);
|
||||
$this->set_min_after_url_wrap($o['typography.wrap.url.minafter']);
|
||||
|
||||
$this->set_space_collapse($o['typography.space.collapse']);
|
||||
$this->set_true_no_break_narrow_space($o['typography.space.nobreak.narrow']);
|
||||
|
||||
// character styling
|
||||
$this->set_style_ampersands($o['typography.style.ampersands']);
|
||||
$this->set_style_caps($o['typography.style.caps']);
|
||||
$this->set_style_numbers($o['typography.style.numbers']);
|
||||
$this->set_style_hanging_punctuation($o['typography.style.punctuation.hanging']);
|
||||
$this->set_style_initial_quotes($o['typography.style.quotes.initial']);
|
||||
$this->set_initial_quote_tags($o['typography.style.quotes.initial.tags']);
|
||||
|
||||
// hyphenation
|
||||
$this->set_hyphenation($o['typography.hyphenation']);
|
||||
$this->set_hyphenation_language($o['typography.hyphenation.language']);
|
||||
$this->set_min_length_hyphenation($o['typography.hyphenation.minlength']);
|
||||
$this->set_min_before_hyphenation($o['typography.hyphenation.minbefore']);
|
||||
$this->set_min_after_hyphenation($o['typography.hyphenation.minafter']);
|
||||
$this->set_hyphenate_headings($o['typography.hyphenation.headings']);
|
||||
$this->set_hyphenate_all_caps($o['typography.hyphenation.allcaps']);
|
||||
$this->set_hyphenate_title_case($o['typography.hyphenation.titlecase']);
|
||||
$this->set_hyphenate_compounds($o['typography.hyphenation.compounds']);
|
||||
$this->set_hyphenation_exceptions($o['typography.hyphenation.exceptions']);
|
||||
|
||||
// set css classes
|
||||
foreach($this->cssClassKeys as $optionKey => $classKey) {
|
||||
$this->css_classes[$classKey] = $o[$optionKey];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the typographical conventions used by smart_dashes.
|
||||
*
|
||||
* Allowed values for $style:
|
||||
* - "em" (alias: "traditionalUS")
|
||||
* - "en" (alias: "international")
|
||||
*
|
||||
* @param string $style Optional. Default "en".
|
||||
*/
|
||||
public function set_smart_dashes_style( $style = 'en' ) {
|
||||
if (isset($this->dashStylesMap[$style])) {
|
||||
// Translate dash styles for PHP-Typography
|
||||
$style = $this->dashStylesMap[$style];
|
||||
}
|
||||
|
||||
return parent::set_smart_dashes_style($style);
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to fetch a list of top-level domains from the IANA. If fetching of that
|
||||
* file fails, load a list of top-level domains from a file.
|
||||
*
|
||||
* @param string $path The full path and filename.
|
||||
* @return string A list of top-level domains concatenated with '|'.
|
||||
*/
|
||||
function get_top_level_domains_from_file($path) {
|
||||
|
||||
$cache = Cache::instance();
|
||||
$cacheKey = 'domain-list-' . md5($this->domainListUrl);
|
||||
$cacheKeyLastAttempt = 'domain-list-last-attempt';
|
||||
$cacheKeyMaxFetchInterval = 30;
|
||||
|
||||
$domains = $cache->get($cacheKey);
|
||||
|
||||
if (!$domains) {
|
||||
$lastAttempt = $cache->get($cacheKeyLastAttempt, false);
|
||||
|
||||
if (!$lastAttempt || $lastAttempt !== $this->domainListUrl) { // only retry, if last attempt to fetch the domain list failed.
|
||||
|
||||
if ($domainListTextFileContents = @file_get_contents($this->domainListUrl)) {
|
||||
$domains = [];
|
||||
|
||||
foreach (explode("\n", $domainListTextFileContents) as $line) {
|
||||
if ( preg_match('#^[a-zA-Z0-9][a-zA-Z0-9-]*$#', $line, $matches ) ) {
|
||||
$domains[] = strtolower( $matches[0] );
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($domains) > 0) {
|
||||
$domains = implode('|', $domains);
|
||||
$cache->set($cacheKey, $domains, $this->domainListCacheLifetime);
|
||||
} else {
|
||||
$domains = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$domains) {
|
||||
$cache->set($cacheKeyLastAttempt, $this->domainListUrl, $cacheKeyMaxFetchInterval);
|
||||
// Fallback to local copy of IANA domains
|
||||
$domains = parent::get_top_level_domains_from_file($path);
|
||||
}
|
||||
|
||||
if (is_array($this->kirby->options['typography.domains.custom']) &&
|
||||
sizeof($this->kirby->options['typography.domains.custom']) > 0) {
|
||||
|
||||
$domains .= '|' . implode('|', $this->kirby->options['typography.domains.custom']);
|
||||
}
|
||||
|
||||
return $domains;
|
||||
}
|
||||
|
||||
protected function getClassAttr($str = '') {
|
||||
return (!empty($str) ? ' class="' . $str . '"' : '');
|
||||
}
|
||||
|
||||
}
|
||||
19
site/OFF_plugins/typography/package.json
Normal file
19
site/OFF_plugins/typography/package.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "typography",
|
||||
"version": "1.0.0-beta1",
|
||||
"description": "This is a port of [wp-Typography](https://de.wordpress.org/plugins/wp-typography/) for Kirby CMS. Based on the `PHP_Typography` class, this plugin enhances the typography of you kirby-powered website. Think of it a more advanced alternative to the built-in `SmartyPants` parser.",
|
||||
"main": "gulpfile.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"type": "kirby-plugin",
|
||||
"author": "Fabian Michael",
|
||||
"license": "GPL-3.0",
|
||||
"repository": "https://github.com/fabianmichael/kirby-typography",
|
||||
"devDependencies": {
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-doctoc": "^0.1.4",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-uglify": "^1.5.3"
|
||||
}
|
||||
}
|
||||
570
site/OFF_plugins/typography/php-typography/class-parse-text.php
Normal file
570
site/OFF_plugins/typography/php-typography/class-parse-text.php
Normal file
|
|
@ -0,0 +1,570 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of wp-Typography.
|
||||
*
|
||||
* Copyright 2014-2016 Peter Putzer.
|
||||
* Copyright 2012-2013 Marie Hogebrandt.
|
||||
* Coypright 2009-2011 KINGdesk, LLC.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package wpTypography/PHPTypography
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
namespace PHP_Typography;
|
||||
|
||||
/**
|
||||
* A class to parse plain text (such as the data of DOMText).
|
||||
*
|
||||
* Parse_Text assumes no HTML markup in the text (except for special html characters like >).
|
||||
* If multibyte characters are passed, they must be encoded as UTF-8.
|
||||
*/
|
||||
class Parse_Text {
|
||||
|
||||
/**
|
||||
* An array of encodings to check.
|
||||
*
|
||||
* @var array $encodings An array of encoding names.
|
||||
*/
|
||||
private $encodings = array();
|
||||
|
||||
/**
|
||||
* A hash map for string functions according to encoding.
|
||||
*
|
||||
* @var array $str_functions {
|
||||
* @type string $encoding The name of the strtoupper function to use.
|
||||
* }
|
||||
*/
|
||||
private $str_functions = array(
|
||||
'UTF-8' => 'mb_strtoupper',
|
||||
'ASCII' => 'strtoupper',
|
||||
false => false,
|
||||
);
|
||||
|
||||
/**
|
||||
* The current strtoupper function to use (either 'strtoupper' or 'mb_strtoupper').
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $current_strtoupper = false;
|
||||
|
||||
/**
|
||||
* The tokenized text.
|
||||
*
|
||||
* @var array $text {
|
||||
* @type array $index {
|
||||
* Tokenized text.
|
||||
*
|
||||
* @type string $type 'space' | 'punctuation' | 'word' | 'other'. Required.
|
||||
* @type string $value Token content. Required.
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
private $text = array();
|
||||
|
||||
/**
|
||||
* An array of various regex components (not complete patterns).
|
||||
*
|
||||
* @var array $components
|
||||
*/
|
||||
private $components = array();
|
||||
|
||||
/**
|
||||
* An array of regex patterns.
|
||||
*
|
||||
* @var array $regex
|
||||
*/
|
||||
private $regex = array();
|
||||
|
||||
/**
|
||||
* Creates a new parser object.
|
||||
*
|
||||
* @param array $encodings Optional. Default [ 'ASCII', 'UTF-8' ].
|
||||
*/
|
||||
function __construct( $encodings = array( 'ASCII', 'UTF-8' ) ) {
|
||||
$this->encodings = $encodings;
|
||||
|
||||
/**
|
||||
* Find spacing FIRST (as it is the primary delimiter)
|
||||
*
|
||||
* Find the HTML character representation for the following characters:
|
||||
* tab | line feed | carriage return | space | non-breaking space | ethiopic wordspace
|
||||
* ogham space mark | en quad space | em quad space | en-space | three-per-em space
|
||||
* four-per-em space | six-per-em space | figure space | punctuation space | em-space
|
||||
* thin space | hair space | narrow no-break space
|
||||
* medium mathematical space | ideographic space
|
||||
* Some characters are used inside words, we will not count these as a space for the purpose
|
||||
* of finding word boundaries:
|
||||
* zero-width-space ("​", "​")
|
||||
* zero-width-joiner ("‌", "‌", "‍")
|
||||
* zero-width-non-joiner ("‍", "‍", "‌")
|
||||
*/
|
||||
$this->components['htmlSpacing'] = '
|
||||
(?:
|
||||
(?: # alpha matches
|
||||
&
|
||||
(?: nbsp|ensp|emsp|thinsp )
|
||||
;
|
||||
)
|
||||
|
|
||||
(?: # decimal matches
|
||||
&\#
|
||||
(?: 09|1[03]|32|160|4961|5760|819[2-9]|820[0-2]|8239|8287|12288 )
|
||||
;
|
||||
)
|
||||
|
|
||||
(?: # hexidecimal matches
|
||||
&\#x
|
||||
(?: 000[9ad]|0020|00a0|1361|1680|200[0-9a]|202f|205f|3000 )
|
||||
;
|
||||
)
|
||||
|
|
||||
(?: # actual characters
|
||||
\x{0009}|\x{000a}|\x{000d}|\x{0020}|\x{00a0}|\x{1361}|\x{2000}|\x{2001}|\x{2002}|\x{2003}|
|
||||
\x{2004}|\x{2005}|\x{2006}|\x{2007}|\x{2008}|\x{2009}|\x{200a}|\x{202f}|\x{205f}|\x{3000}
|
||||
)
|
||||
)
|
||||
'; // required modifiers: x (multiline pattern) i (case insensitive) u (utf8).
|
||||
$this->components['space'] = "(?:\s|{$this->components['htmlSpacing']})+"; // required modifiers: x (multiline pattern) i (case insensitive) $utf8.
|
||||
|
||||
/**
|
||||
* Find punctuation and symbols before words (to capture preceeding delimiating characters like hyphens or underscores)
|
||||
*
|
||||
* @see http://www.unicode.org/charts/PDF/U2000.pdf
|
||||
*
|
||||
* Find punctuation and symbols
|
||||
* dec matches = 33-44|46-47|58-60|62-64|91-94|96|123-126|161-172|174-191|215|247|710|732|977-978|982|8211-8231|8240-8286|8289-8292|8352-8399|8448-8527|8592-9215|9632-9983|11776-11903
|
||||
* hex matches = 0021-002c|002e-002f|003a-003c|003e-0040|005b-e|0060|007b-007e|00a1-00ac|00ae-00bf|00d7|00f7|02c6|02dc|03d1-03d2|
|
||||
* 03d6|2013-2027|2030-205e|2061-2064|20a0-20cf|2100-214f|2190-23ff|25a0-26ff|2e00-2e7f
|
||||
*
|
||||
* Some characters are used inside words, we will not count these as a space for the purpose
|
||||
* of finding word boundaries:
|
||||
* hyphens ("-", "­", "‐", "‑", "‒", "-", "­", "‐", "‑", "‒", "­")
|
||||
* underscore ("_", "_")
|
||||
*/
|
||||
$this->components['htmlPunctuation'] = '
|
||||
(?:
|
||||
(?: # alpha matches
|
||||
&
|
||||
(?:quot|amp|frasl|lt|gt|iexcl|cent|pound|curren|yen|brvbar|sect|uml|pound|ordf|laquo|not|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|times|divide|circ|tilde|thetasym|upsih|piv|ndash|mdash|lsquo|rsquo|sbquo|ldquo|rdquo|bdquo|dagger|Dagger|bull|hellip|permil|prime|Prime|lsaquo|rsaquo|oline|frasl|euro|trade|alefsym|larr|uarr|rarr|darr|harr|crarr|lArr|uArr|rArr|dArr|hArr|forall|part|exist|emptyn|abla|isin|notin|ni|prod|sum|minus|lowast|radic|prop|infin|ang|and|orc|ap|cup|int|there4|simc|ong|asymp|ne|equiv|le|ge|sub|supn|sub|sube|supe|oplus|otimes|perp|sdot|lceil|rceil|lfloor|rfloor|lang|rang|loz|spades|clubs|hearts|diams)
|
||||
;
|
||||
)
|
||||
|
|
||||
(?: # decimal matches
|
||||
&\#
|
||||
(?: 3[3-9]|4[0-467]|5[89]|6[02-4]|9[1-46]|12[3-6]|16[1-9]|17[0-24-9]|18[0-9]|19[01]|215|247|710|732|97[78]|982|821[1-9]|822[0-9]|823[01]|82[4-7][0-9]|828[0-6]|8289|829[0-2]|835[2-9]|86[6-9][0-9]|844[89]|84[5-9][0-9]|851[0-9]|852[0-7]|859[2-9]|85[6-9][0-9]|8[6-9][0-9][0-9]|9[01][0-9][0-9]|920[0-9]|921[0-5]|963[2-9]|96[4-9][0-9]|9[78][0-9][0-9]|99[0-7][0-9]|998[0-3]|1177[6-9]|117[89][0-9]|118[0-9][0-9]|1190[0-3] )
|
||||
;
|
||||
)
|
||||
|
|
||||
(?: # hexidecimal matches
|
||||
&\#x
|
||||
(?: 002[1-9a-cef]|003[a-cef]|0040|005[b-e]|0060|007[b-e]|00a[1-9a-cef]|00b[0-9a-f]|00d7|00f7|02c6|02dc|03d[126]|201[3-9a-f]|202[0-7]|20[34][0-9a-f]|205[0-9a-e]|206[1-4]|20[a-c][0-9a-f]|21[0-4][0-9a-f]|219[0-9a-f]|2[23][0-9a-f][0-9a-f]|25[a-f][0-9a-f]|23[0-9a-f][0-9a-f]|2e[0-7][0-9a-f] )
|
||||
;
|
||||
)
|
||||
)
|
||||
'; // required modifiers: x (multiline pattern) i (case insensitive) u (utf8).
|
||||
$this->components['punctuation'] = "
|
||||
(?:
|
||||
(?:
|
||||
[^\w\s\&\/\@] # assume characters that are not word spaces or whitespace are punctuation
|
||||
# exclude & as that is an illegal stand-alone character (and would interfere with HTML character representations
|
||||
# exclude slash \/as to not include the last slash in a URL
|
||||
# exclude @ as to keep twitter names together
|
||||
|
|
||||
{$this->components['htmlPunctuation']} # catch any HTML reps of punctuation
|
||||
)+
|
||||
)
|
||||
";// required modifiers: x (multiline pattern) i (case insensitive) u (utf8).
|
||||
|
||||
/**
|
||||
* Letter connectors allowed in words
|
||||
* hyphens ("-", "­", "‐", "‑", "‒", "-", "­", "‐", "‑", "‒", "­")
|
||||
* underscore ("_", "_")
|
||||
* zero-width-space ("​", "​")
|
||||
* zero-width-joiner ("‌", "‌", "‍")
|
||||
* zero-width-non-joiner ("‍", "‍", "‌")
|
||||
*/
|
||||
$this->components['htmlLetterConnectors'] = '
|
||||
(?:
|
||||
(?: # alpha matches
|
||||
&
|
||||
(?: shy|zwj|zwnj )
|
||||
;
|
||||
)
|
||||
|
|
||||
(?: # decimal matches
|
||||
&\#
|
||||
(?: 45|95|173|820[3-589]|8210 )
|
||||
;
|
||||
)
|
||||
|
|
||||
(?: # hexidecimal matches
|
||||
&\#x
|
||||
(?: 002d|005f|00ad|200[b-d]|201[0-2] )
|
||||
;
|
||||
)
|
||||
|
|
||||
(?: # actual characters
|
||||
\x{002d}|\x{005f}|\x{00ad}|\x{200b}|\x{200c}|\x{200d}|\x{2010}|\x{2011}|\x{2012}
|
||||
)
|
||||
)
|
||||
'; // required modifiers: x (multiline pattern) i (case insensitive) u (utf8).
|
||||
|
||||
/**
|
||||
* Word character html entities
|
||||
* characters 0-9__ A-Z__ a-z___ other_special_chrs_____
|
||||
* decimal 48-57 65-90 97-122 192-214,216-246,248-255, 256-383
|
||||
* hex 31-39 41-5a 61-7a c0-d6 d8-f6 f8-ff 0100-017f
|
||||
*/
|
||||
$this->components['htmlLetters'] = '
|
||||
(?:
|
||||
(?: # alpha matches
|
||||
&
|
||||
(?:Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml)
|
||||
;
|
||||
)
|
||||
|
|
||||
(?: # decimal matches
|
||||
&\#
|
||||
(?: 4[89]|5[0-7]|9[7-9]|1[01][0-9]|12[0-2]|19[2-9]|20[0-9]|21[0-46-9]|2[23][0-9]|24[0-68-9]|2[5-9][0-9]|3[0-7][0-9]|38[0-3] )
|
||||
;
|
||||
)
|
||||
|
|
||||
(?: # hexidecimal matches
|
||||
(?:
|
||||
&\#x00
|
||||
(?: 3[1-9]|4[1-9a-f]|5[0-9a]|6[1-9a-f]|7[0-9a]|c[0-9a-f]|d[0-689]|e[0-9a-f]|f[0-689a-f] )
|
||||
;
|
||||
)
|
||||
|
|
||||
(?:
|
||||
&\#x01[0-7][0-9a-f];
|
||||
)
|
||||
)
|
||||
|
|
||||
(?: # actual characters
|
||||
[0-9A-Za-z]|\x{00c0}|\x{00c1}|\x{00c2}|\x{00c3}|\x{00c4}|\x{00c5}|\x{00c6}|\x{00c7}|\x{00c8}|\x{00c9}|
|
||||
\x{00ca}|\x{00cb}|\x{00cc}|\x{00cd}|\x{00ce}|\x{00cf}|\x{00d0}|\x{00d1}|\x{00d2}|\x{00d3}|\x{00d4}|
|
||||
\x{00d5}|\x{00d6}|\x{00d8}|\x{00d9}|\x{00da}|\x{00db}|\x{00dc}|\x{00dd}|\x{00de}|\x{00df}|\x{00e0}|
|
||||
\x{00e1}|\x{00e2}|\x{00e3}|\x{00e4}|\x{00e5}|\x{00e6}|\x{00e7}|\x{00e8}|\x{00e9}|\x{00ea}|\x{00eb}|
|
||||
\x{00ec}|\x{00ed}|\x{00ee}|\x{00ef}|\x{00f0}|\x{00f1}|\x{00f2}|\x{00f3}|\x{00f4}|\x{00f5}|\x{00f6}|
|
||||
\x{00f8}|\x{00f9}|\x{00fa}|\x{00fb}|\x{00fc}|\x{00fd}|\x{00fe}|\x{00ff}|\x{0100}|\x{0101}|\x{0102}|
|
||||
\x{0103}|\x{0104}|\x{0105}|\x{0106}|\x{0107}|\x{0108}|\x{0109}|\x{010a}|\x{010b}|\x{010c}|\x{010d}|
|
||||
\x{010e}|\x{010f}|\x{0110}|\x{0111}|\x{0112}|\x{0113}|\x{0114}|\x{0115}|\x{0116}|\x{0117}|\x{0118}|
|
||||
\x{0119}|\x{011a}|\x{011b}|\x{011c}|\x{011d}|\x{011e}|\x{011f}|\x{0120}|\x{0121}|\x{0122}|\x{0123}|
|
||||
\x{0124}|\x{0125}|\x{0126}|\x{0127}|\x{0128}|\x{0129}|\x{012a}|\x{012b}|\x{012c}|\x{012d}|\x{012e}|
|
||||
\x{012f}|\x{0130}|\x{0131}|\x{0132}|\x{0133}|\x{0134}|\x{0135}|\x{0136}|\x{0137}|\x{0138}|\x{0139}|
|
||||
\x{013a}|\x{013b}|\x{013c}|\x{013d}|\x{013e}|\x{013f}|\x{0140}|\x{0141}|\x{0142}|\x{0143}|\x{0144}|
|
||||
\x{0145}|\x{0146}|\x{0147}|\x{0148}|\x{0149}|\x{014a}|\x{014b}|\x{014c}|\x{014d}|\x{014e}|\x{014f}|
|
||||
\x{0150}|\x{0151}|\x{0152}|\x{0153}|\x{0154}|\x{0155}|\x{0156}|\x{0157}|\x{0158}|\x{0159}|\x{015a}|
|
||||
\x{015b}|\x{015c}|\x{015d}|\x{015e}|\x{015f}|\x{0160}|\x{0161}|\x{0162}|\x{0163}|\x{0164}|\x{0165}|
|
||||
\x{0166}|\x{0167}|\x{0168}|\x{0169}|\x{016a}|\x{016b}|\x{016c}|\x{016d}|\x{016e}|\x{016f}|\x{0170}|
|
||||
\x{0171}|\x{0172}|\x{0173}|\x{0174}|\x{0175}|\x{0176}|\x{0177}|\x{0178}|\x{0179}|\x{017a}|\x{017b}|
|
||||
\x{017c}|\x{017d}|\x{017e}|\x{017f}
|
||||
)
|
||||
)
|
||||
'; // required modifiers: x (multiline pattern) i (case insensitive) u (utf8).
|
||||
|
||||
$this->components['word'] = "
|
||||
(?:
|
||||
(?<![\w\&]) # negative lookbehind to ensure
|
||||
# 1) we are proceeded by a non-word-character, and
|
||||
# 2) we are not inside an HTML character def
|
||||
(?:
|
||||
[\w\-\_\/]
|
||||
|
|
||||
{$this->components['htmlLetters']}
|
||||
|
|
||||
{$this->components['htmlLetterConnectors']}
|
||||
)+
|
||||
)
|
||||
"; // required modifiers: x (multiline pattern) u (utf8).
|
||||
|
||||
// Find any text
|
||||
$this->components['anyText'] = "{$this->components['space']}|{$this->components['punctuation']}|{$this->components['word']}"; // required modifiers: x (multiline pattern) i (case insensitive) u (utf8).
|
||||
|
||||
// Store compiled regexes for later use & use S modifier ('study').
|
||||
$this->regex['anyText'] = "/({$this->components['anyText']})/Sixu";
|
||||
$this->regex['space'] = "/\A{$this->components['space']}\Z/Sxiu";
|
||||
$this->regex['punctuation'] = "/\A{$this->components['punctuation']}\Z/Ssxiu";
|
||||
$this->regex['word'] = "/\A{$this->components['word']}\Z/Sxu";
|
||||
$this->regex['htmlLetterConnectors'] = "/{$this->components['htmlLetterConnectors']}|[0-9\-_&#;\/]/Sxu";
|
||||
$this->regex['maxStringLength'] = '@\w{500}@Ss';
|
||||
}
|
||||
|
||||
/**
|
||||
* Tokenize a string and store the tokens in $this->text.
|
||||
*
|
||||
* @param string $raw_text A text fragment without any HTML markup.
|
||||
* @return boolean Returns `true` on successful completion, `false` otherwise.
|
||||
*/
|
||||
function load( $raw_text ) {
|
||||
if ( ! is_string( $raw_text ) ) {
|
||||
return false; // we have an error, abort.
|
||||
}
|
||||
|
||||
// Abort if a simple string exceeds 500 characters (security concern).
|
||||
if ( preg_match( $this->regex['maxStringLength'], $raw_text ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Detect encoding.
|
||||
$this->current_strtoupper = $this->str_functions[ mb_detect_encoding( $raw_text, $this->encodings, true ) ];
|
||||
if ( ! $this->current_strtoupper ) {
|
||||
return false; // unknown encoding.
|
||||
}
|
||||
|
||||
$tokens = array();
|
||||
$parts = preg_split( $this->regex['anyText'], $raw_text, -1, PREG_SPLIT_DELIM_CAPTURE );
|
||||
|
||||
$index = 0;
|
||||
foreach ( $parts as $part ) {
|
||||
if ( '' !== $part ) {
|
||||
|
||||
if ( preg_match( $this->regex['space'], $part ) ) {
|
||||
$tokens[ $index ] = array(
|
||||
'type' => 'space',
|
||||
'value' => $part,
|
||||
);
|
||||
} elseif ( preg_match( $this->regex['punctuation'], $part ) ) {
|
||||
$tokens[ $index ] = array(
|
||||
'type' => 'punctuation',
|
||||
'value' => $part,
|
||||
);
|
||||
} elseif ( preg_match( $this->regex['word'], $part ) ) {
|
||||
// Make sure that things like email addresses and URLs are not broken up
|
||||
// into words and punctuation not preceeded by an 'other'.
|
||||
if ( $index - 1 >= 0 && 'other' === $tokens[ $index - 1 ]['type'] ) {
|
||||
$old_part = $tokens[ $index - 1 ]['value'];
|
||||
$tokens[ $index - 1 ] = array(
|
||||
'type' => 'other',
|
||||
'value' => $old_part . $part,
|
||||
);
|
||||
$index = $index - 1;
|
||||
|
||||
// Not preceeded by a non-space + punctuation.
|
||||
} elseif ( $index - 2 >= 0 && 'punctuation' === $tokens[ $index - 1 ]['type'] && 'space' !== $tokens[ $index - 2 ]['type'] ) {
|
||||
$old_part = $tokens[ $index - 1 ]['value'];
|
||||
$older_part = $tokens[ $index - 2 ]['value'];
|
||||
$tokens[ $index - 2 ] = array(
|
||||
'type' => 'other',
|
||||
'value' => $older_part . $old_part . $part,
|
||||
);
|
||||
unset( $tokens[ $index - 1 ] );
|
||||
$index = $index - 2;
|
||||
} else {
|
||||
$tokens[ $index ] = array(
|
||||
'type' => 'word',
|
||||
'value' => $part,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// Make sure that things like email addresses and URLs are not broken up into words
|
||||
// and punctuation not preceeded by an 'other' or 'word'.
|
||||
if ( $index - 1 >= 0 && ( 'word' === $tokens[ $index - 1 ]['type'] || 'other' === $tokens[ $index - 1 ]['type'] ) ) {
|
||||
$index = $index - 1;
|
||||
$old_part = $tokens[ $index ]['value'];
|
||||
$tokens[ $index ] = array(
|
||||
'type' => 'other',
|
||||
'value' => $old_part . $part,
|
||||
);
|
||||
// Not preceeded by a non-space + punctuation.
|
||||
} elseif ( $index - 2 >= 0 && 'punctuation' === $tokens[ $index - 1 ]['type'] && 'space' !== $tokens[ $index - 2 ]['type'] ) {
|
||||
$old_part = $tokens[ $index - 1 ]['value'];
|
||||
$older_part = $tokens[ $index - 2 ]['value'];
|
||||
$tokens[ $index - 2 ] = array(
|
||||
'type' => 'other',
|
||||
'value' => $older_part . $old_part . $part,
|
||||
);
|
||||
unset( $tokens[ $index - 1 ] );
|
||||
$index = $index - 2;
|
||||
} else {
|
||||
$tokens[ $index ] = array(
|
||||
'type' => 'other',
|
||||
'value' => $part,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->text = $tokens;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads $this->text (i.e. capture new inserted text, or remove those tokens whose values have been deleted).
|
||||
*
|
||||
* Warning: Tokens previously acquired through 'get' methods may not match new tokenization.
|
||||
*
|
||||
* @return boolean Returns true on successful completion.
|
||||
*/
|
||||
function reload() {
|
||||
return $this->load( $this->unload() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the complete text as a string and clears the parser.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function unload() {
|
||||
$reassembled_text = '';
|
||||
|
||||
foreach ( $this->text as $token ) {
|
||||
$reassembled_text .= $token['value'];
|
||||
}
|
||||
|
||||
$this->clear();
|
||||
|
||||
return $reassembled_text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the currently set text from the parser.
|
||||
*/
|
||||
function clear() {
|
||||
$this->text = array();
|
||||
$this->current_strtoupper = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the 'value' field for all matching tokens.
|
||||
*
|
||||
* @param array $tokens {
|
||||
* An array of tokens.
|
||||
*
|
||||
* @type string $value
|
||||
* }
|
||||
*/
|
||||
function update( $tokens ) {
|
||||
foreach ( $tokens as $index => $token ) {
|
||||
$this->text[ $index ]['value'] = $token['value'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all tokens of the currently set text.
|
||||
*
|
||||
* @return array An array of tokens.
|
||||
*/
|
||||
function get_all() {
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all tokens of the type "space".
|
||||
*
|
||||
* @return array An array of tokens.
|
||||
*/
|
||||
function get_spaces() {
|
||||
return $this->get_type( 'space' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all tokens of the type "punctuation".
|
||||
*
|
||||
* @return array An array of tokens.
|
||||
*/
|
||||
function get_punctuation() {
|
||||
return $this->get_type( 'punctuation' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all tokens of the type "word".
|
||||
*
|
||||
* @param string $abc Handling of all-letter words. Allowed values 'no-all-letters', 'allow-all-letters', 'require-all-letters'. Optional. Default 'allow-all-letters'.
|
||||
* @param string $caps Handling of capitalized words (setting does not affect non-letter characters). Allowed values 'no-all-caps', 'allow-all-caps', 'require-all-caps'. Optional. Default 'allow-all-caps'.
|
||||
* @param string $comps Handling of compound words (setting does not affect all-letter words). Allowed values 'no-compounds', 'allow-compounds', 'require-compounds'. Optional. Default 'no-compounds'.
|
||||
*/
|
||||
function get_words( $abc = 'allow-all-letters', $caps = 'allow-all-caps', $comps = 'allow-compounds' ) {
|
||||
$tokens = array();
|
||||
$strtoupper = $this->current_strtoupper; // cannot call class properties.
|
||||
|
||||
// Initialize helper variables outside the loop.
|
||||
$capped = '';
|
||||
$lettered = '';
|
||||
$compound = '';
|
||||
|
||||
foreach ( $this->get_type( 'word' ) as $index => $token ) {
|
||||
$capped = $strtoupper( $token['value'] );
|
||||
$lettered = preg_replace( $this->regex['htmlLetterConnectors'], '', $token['value'] );
|
||||
$compound = preg_replace( '/[^\w-]/Su', '', $token['value'] );
|
||||
|
||||
// @todo Refactor these tangled if statements.
|
||||
// @codingStandardsIgnoreStart.
|
||||
if ( 'no-all-letters' === $abc && $lettered !== $token['value'] ) {
|
||||
if ( ( ( 'no-all-caps' === $caps && $capped !== $token['value'] ) ||
|
||||
( 'allow-all-caps' === $caps ) ||
|
||||
( 'require-all-caps' === $caps && $capped === $token['value'] ) ) &&
|
||||
( ( 'no-compounds' === $comps && $compound !== $token['value'] ) ||
|
||||
( 'allow-compounds' === $comps ) ||
|
||||
( 'require-compounds' === $comps && $compound === $token['value'] ) ) ) {
|
||||
$tokens[ $index ] = $token;
|
||||
}
|
||||
} elseif ( 'allow-all-letters' === $abc ) {
|
||||
if ( ( ( 'no-all-caps' === $caps && $capped !== $token['value'] ) ||
|
||||
( 'allow-all-caps' === $caps ) ||
|
||||
( 'require-all-caps' === $caps && $capped === $token['value'] ) ) &&
|
||||
( ( 'no-compounds' === $comps && $compound !== $token['value'] ) ||
|
||||
( 'allow-compounds' === $comps ) ||
|
||||
( 'require-compounds' === $comps && $compound === $token['value'] ) ) ) {
|
||||
$tokens[ $index ] = $token;
|
||||
}
|
||||
} elseif ( 'require-all-letters' === $abc && $lettered === $token['value'] ) {
|
||||
if ( ( 'no-all-caps' === $caps && $capped !== $token['value'] ) ||
|
||||
( 'allow-all-caps' === $caps ) ||
|
||||
( 'require-all-caps' === $caps && $capped === $token['value'] ) ) {
|
||||
$tokens[ $index ] = $token;
|
||||
}
|
||||
}
|
||||
// @codingStandardsIgnoreEnd.
|
||||
}
|
||||
|
||||
return $tokens;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all tokens of the type "other".
|
||||
*
|
||||
* @return array An array of tokens.
|
||||
*/
|
||||
function get_other() {
|
||||
return $this->get_type( 'other' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all tokens of the given type.
|
||||
*
|
||||
* @param string $type The type to get.
|
||||
*/
|
||||
function get_type( $type ) {
|
||||
$tokens = array();
|
||||
|
||||
foreach ( $this->text as $index => $token ) {
|
||||
if ( $token['type'] === $type ) {
|
||||
$tokens[ $index ] = $token;
|
||||
}
|
||||
}
|
||||
|
||||
return $tokens;
|
||||
}
|
||||
}
|
||||
3386
site/OFF_plugins/typography/php-typography/class-php-typography.php
Normal file
3386
site/OFF_plugins/typography/php-typography/class-php-typography.php
Normal file
File diff suppressed because it is too large
Load diff
400
site/OFF_plugins/typography/php-typography/diacritics/de-DE.php
Normal file
400
site/OFF_plugins/typography/php-typography/diacritics/de-DE.php
Normal file
|
|
@ -0,0 +1,400 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Language: German
|
||||
*
|
||||
* An array of all words containing diacritics (and their non-diacritic
|
||||
* alternatives that should be replaced), provided a legitimate English
|
||||
* word does not exist without such diacritic characters (i.e.
|
||||
* divorcé & divorce, exposé & expose, résumé & resume ).
|
||||
*
|
||||
* In the form of $diacriticWords = array( key => value );
|
||||
* where "key" is the needle and "value" is the replacement
|
||||
*
|
||||
* @package wpTypography
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
$diacriticLanguage = 'German';
|
||||
|
||||
$diacritic_words = array(
|
||||
"a bas"=>"à bas",
|
||||
"A bas"=>"À bas",
|
||||
"a la"=>"à la",
|
||||
"A la"=>"À la",
|
||||
"a la carte"=>"à la carte",
|
||||
"A la carte"=>"À la carte",
|
||||
"a la mode"=>"à la mode",
|
||||
"A la mode"=>"À la mode",
|
||||
"a gogo"=>"à gogo",
|
||||
"A gogo"=>"À gogo",
|
||||
"abbe"=>"abbé",
|
||||
"Abbe"=>"Abbé",
|
||||
"adios"=>"adiós",
|
||||
"Adios"=>"Adiós",
|
||||
"agrement"=>"agrément",
|
||||
"Agrement"=>"Agrément",
|
||||
"Ancien Regime"=>"Ancien Régime",
|
||||
"angstrom"=>"ångström",
|
||||
"Angstrom"=>"Ångström",
|
||||
"anu"=>"añu",
|
||||
"Anu"=>"Añu",
|
||||
"ao dai"=>"áo dài",
|
||||
"Ao dai"=>"Áo dài",
|
||||
"aperitif"=>"apéritif",
|
||||
"Aperitif"=>"Apéritif",
|
||||
"applique"=>"appliqué",
|
||||
"Applique"=>"Appliqué",
|
||||
"apres-ski"=>"après-ski",
|
||||
"Apres-ski"=>"Après-ski",
|
||||
"arete"=>"arête",
|
||||
"Arete"=>"Arête",
|
||||
"attache"=>"attaché",
|
||||
"Attache"=>"Attaché",
|
||||
"auto-da-fe"=>"auto-da-fé",
|
||||
"Auto-da-fe"=>"Auto-da-fé",
|
||||
"acaí"=>"açaí",
|
||||
"Acaí"=>"Açaí",
|
||||
"belle epoque"=>"belle époque",
|
||||
"Belle epoque"=>"Belle époque",
|
||||
"bete noire"=>"bête noire",
|
||||
"Bete noire"=>"Bête noire",
|
||||
"betise"=>"bêtise",
|
||||
"Betise"=>"Bêtise",
|
||||
"blase"=>"blasé",
|
||||
"boite"=>"boîte",
|
||||
"Boite"=>"Boîte",
|
||||
"boutonniere"=>"boutonnière",
|
||||
"Boutonniere"=>"Boutonnière",
|
||||
"bric-a-brac"=>"bric-à-brac",
|
||||
"Bric-a-brac"=>"Bric-à-brac",
|
||||
"cafe"=>"café",
|
||||
"Cafe"=>"Café",
|
||||
"canape"=>"canapé",
|
||||
"Canape"=>"Canapé",
|
||||
"Champs-Elysees"=>"Champs-Élysées",
|
||||
"chateau"=>"château",
|
||||
"Chateau"=>"Château",
|
||||
"charge d'affaires"=>"chargé d'affaires",
|
||||
"Charge d'affaires"=>"Chargé d'affaires",
|
||||
"cause celebre"=>"cause célèbre",
|
||||
"Cause celebre"=>"Cause célèbre",
|
||||
"chaines"=>"chaînés",
|
||||
"Chaines"=>"Chaînés",
|
||||
"cinema verite"=>"cinéma vérité",
|
||||
"Cinema verite"=>"Cinéma vérité",
|
||||
"cliche"=>"cliché",
|
||||
"Cliche"=>"Cliché",
|
||||
"cloisonne"=>"cloisonné",
|
||||
"Cloisonne"=>"Cloisonné",
|
||||
"consomme"=>"consommé",
|
||||
"Consomme"=>"Consommé",
|
||||
"communique"=>"communiqué",
|
||||
"Communique"=>"Communiqué",
|
||||
"confrere"=>"confrère",
|
||||
"Confrere"=>"Confrère",
|
||||
"coopt"=>"coöpt",
|
||||
"Coopt"=>"Coöpt",
|
||||
"cortege"=>"cortège",
|
||||
"Cortege"=>"Cortège",
|
||||
"coup d'etat"=>"coup d'état",
|
||||
"Coup d'etat"=>"Coup d'état",
|
||||
"coup de grace"=>"coup de grâce",
|
||||
"Coup de grace"=>"Coup de grâce",
|
||||
"creche"=>"crèche",
|
||||
"Creche"=>"Crèche",
|
||||
"coulee"=>"coulée",
|
||||
"Coulee"=>"Coulée",
|
||||
"creme brulee"=>"crème brûlée",
|
||||
"Creme brulee"=>"Crème brûlée",
|
||||
"creme fraiche"=>"crème fraîche",
|
||||
"Creme fraiche"=>"Crème fraîche",
|
||||
"creme"=>"crème",
|
||||
"Creme"=>"Crème",
|
||||
"crepe"=>"crêpe",
|
||||
"Crepe"=>"Crêpe",
|
||||
"Creusa"=>"Creüsa",
|
||||
"crouton"=>"croûton",
|
||||
"Crouton"=>"Croûton",
|
||||
"crudites"=>"crudités",
|
||||
"Crudites"=>"Crudités",
|
||||
"Curacao"=>"Curaçao",
|
||||
"dais"=>"daïs",
|
||||
"Dais"=>"Daïs",
|
||||
"dau hoi"=>"dấu hỏi",
|
||||
"Dau hoi"=>"Dấu hỏi",
|
||||
"debutante"=>"débutante",
|
||||
"Debutante"=>"Débutante",
|
||||
"declasse"=>"déclassé",
|
||||
"Declasse"=>"Déclassé",
|
||||
"decolletage"=>"décolletage",
|
||||
"Decolletage"=>"Décolletage",
|
||||
"decollete"=>"décolleté",
|
||||
"Decollete"=>"Décolleté",
|
||||
"decor"=>"décor",
|
||||
"Decor"=>"Décor",
|
||||
"decoupage"=>"découpage",
|
||||
"Decoupage"=>"Découpage",
|
||||
"degage"=>"dégagé",
|
||||
"Degage"=>"Dégagé",
|
||||
"deja vu"=>"déjà vu",
|
||||
"Deja vu"=>"Déjà vu",
|
||||
"demode"=>"démodé",
|
||||
"Demode"=>"Démodé",
|
||||
"denouement"=>"dénouement",
|
||||
"Denouement"=>"Dénouement",
|
||||
"derailleur"=>"dérailleur",
|
||||
"Derailleur"=>"Dérailleur",
|
||||
"derriere"=>"derrière",
|
||||
"Derriere"=>"Derrière",
|
||||
"deshabille"=>"déshabillé",
|
||||
"Deshabille"=>"Déshabillé",
|
||||
"detente"=>"détente",
|
||||
"Detente"=>"Détente",
|
||||
"diamante"=>"diamanté",
|
||||
"Diamante"=>"Diamanté",
|
||||
"discotheque"=>"discothèque",
|
||||
"Discotheque"=>"Discothèque",
|
||||
"doppelganger"=>"doppelgänger",
|
||||
"Doppelganger"=>"Doppelgänger",
|
||||
"eclair"=>"éclair",
|
||||
"Eclair"=>"Éclair",
|
||||
"eclat"=>"éclat",
|
||||
"Eclat"=>"Éclat",
|
||||
"Eire"=>"Éire",
|
||||
"El Nino"=>"El Niño",
|
||||
"elan"=>"élan",
|
||||
"Elan"=>"Élan",
|
||||
"emigre"=>"émigré",
|
||||
"Emigre"=>"Émigré",
|
||||
"entree"=>"entrée",
|
||||
"Entree"=>"Entrée",
|
||||
"entrepot"=>"entrepôt",
|
||||
"Entrepot"=>"Entrepôt",
|
||||
"entrecote"=>"entrecôte",
|
||||
"Entrecote"=>"Entrecôte",
|
||||
"epee"=>"épée",
|
||||
"Epee"=>"Épée",
|
||||
"etouffee"=>"étouffée",
|
||||
"Etouffee"=>"Étouffée",
|
||||
"etude"=>"étude",
|
||||
"Etude"=>"Étude",
|
||||
"facade"=>"façade",
|
||||
"Facade"=>"Façade",
|
||||
"fete"=>"fête",
|
||||
"Fete"=>"Fête",
|
||||
"faience"=>"faïence",
|
||||
"Faience"=>"Faïence",
|
||||
"fiance"=>"fiancé",
|
||||
"Fiance"=>"Fiancé",
|
||||
"fiancee"=>"fiancée",
|
||||
"Fiancee"=>"Fiancée",
|
||||
"filmjolk"=>"filmjölk",
|
||||
"Filmjolk"=>"Filmjölk",
|
||||
"fin de siecle"=>"fin de siècle",
|
||||
"Fin de siecle"=>"Fin de siècle",
|
||||
"flambe"=>"flambé",
|
||||
"Flambe"=>"Flambé",
|
||||
"fleche"=>"flèche",
|
||||
"Fleche"=>"Flèche",
|
||||
"folie a deux"=>"folie à deux",
|
||||
"Folie a deux"=>"Folie à deux",
|
||||
"fouette"=>"fouetté",
|
||||
"Fouette"=>"Fouetté",
|
||||
"frappe"=>"frappé",
|
||||
"Frappe"=>"Frappé",
|
||||
"garcon"=>"garçon",
|
||||
"Garcon"=>"Garçon",
|
||||
"gateau"=>"gâteau",
|
||||
"Gateau"=>"Gâteau",
|
||||
"glace"=>"glacé",
|
||||
"Glace"=>"Glacé",
|
||||
"glogg"=>"glögg",
|
||||
"Glogg"=>"Glögg",
|
||||
"gruyere"=>"gruyère",
|
||||
"Gruyere"=>"Gruyère",
|
||||
"habitue"=>"habitué",
|
||||
"Habitue"=>"Habitué",
|
||||
"hacek"=>"háček",
|
||||
"Hacek"=>"Háček",
|
||||
"hors d’oeuvre"=>"hors d’œuvre",
|
||||
"Hors d’oeuvre"=>"Hors d’œuvre",
|
||||
"ingenue"=>"ingénue",
|
||||
"Ingenue"=>"Ingénue",
|
||||
"jalapeno"=>"jalapeño",
|
||||
"Jalapeno"=>"Jalapeño",
|
||||
"jardiniere"=>"jardinière",
|
||||
"Jardiniere"=>"Jardinière",
|
||||
"krouzek"=>"kroužek",
|
||||
"Krouzek"=>"Kroužek",
|
||||
"kaldolmar"=>"kåldolmar",
|
||||
"Kaldolmar"=>"Kåldolmar",
|
||||
"karaoke"=>"karaōke",
|
||||
"Karaoke"=>"Karaōke",
|
||||
"langue d'oil"=>"langue d'oïl",
|
||||
"Langue d'oil"=>"Langue d'oïl",
|
||||
"La Nina"=>"La Niña",
|
||||
"litterateur"=>"littérateur",
|
||||
"Litterateur"=>"Littérateur",
|
||||
"lycee"=>"lycée",
|
||||
"Lycee"=>"Lycée",
|
||||
"macedoine"=>"macédoine",
|
||||
"Macedoine"=>"Macédoine",
|
||||
"macrame"=>"macramé",
|
||||
"Macrame"=>"Macramé",
|
||||
"maitre d'hotel"=>"maître d'hôtel",
|
||||
"Maitre d'hotel"=>"Maître d'hôtel",
|
||||
"malaguena"=>"malagueña",
|
||||
"Malaguena"=>"Malagueña",
|
||||
"manana"=>"mañana",
|
||||
"Manana"=>"Mañana",
|
||||
"manege"=>"manège",
|
||||
"Manege"=>"Manège",
|
||||
"manoeuvre"=>"manœuvre",
|
||||
"Manoeuvre"=>"Manœuvre",
|
||||
"manque"=>"manqué",
|
||||
"Manque"=>"Manqué",
|
||||
"materiel"=>"matériel",
|
||||
"Materiel"=>"Matériel",
|
||||
"matinee"=>"matinée",
|
||||
"Matinee"=>"Matinée",
|
||||
"melange"=>"mélange",
|
||||
"Melange"=>"Mélange",
|
||||
"melee"=>"mêlée",
|
||||
"Melee"=>"Mêlée",
|
||||
"menage a trois"=>"ménage à trois",
|
||||
"Menage a trois"=>"Ménage à trois",
|
||||
"mesalliance"=>"mésalliance",
|
||||
"Mesalliance"=>"Mésalliance",
|
||||
"metier"=>"métier",
|
||||
"Metier"=>"Métier",
|
||||
"Metis"=>"Métis",
|
||||
"minaudiere"=>"minaudière",
|
||||
"Minaudiere"=>"Minaudière",
|
||||
"moire"=>"moiré",
|
||||
"Moire"=>"Moiré",
|
||||
"Montreal"=>"Montréal",
|
||||
"naif"=>"naïf",
|
||||
"Naif"=>"Naïf",
|
||||
"naive"=>"naïve",
|
||||
"Naive"=>"Naïve",
|
||||
"naivete"=>"naïveté",
|
||||
"Naivete"=>"Naïveté",
|
||||
"ne"=>"né",
|
||||
"Ne"=>"Né",
|
||||
"nee"=>"née",
|
||||
"Nee"=>"Née",
|
||||
"negligee"=>"négligée",
|
||||
"Negligee"=>"Négligée",
|
||||
"Neufchatel"=>"Neufchâtel",
|
||||
"Nez Perce"=>"Nez Percé",
|
||||
"Noel"=>"Noël",
|
||||
"numero uno"=>"número uno",
|
||||
"Numero uno"=>"Número uno",
|
||||
"Montano"=>"Montaño",
|
||||
"objet trouve"=>"objet trouvé",
|
||||
"Objet trouve"=>"Objet trouvé",
|
||||
"ole"=>"olé",
|
||||
"Ole"=>"Olé",
|
||||
"ombre"=>"ombré",
|
||||
"Ombre"=>"Ombré",
|
||||
"omerta"=>"omertà",
|
||||
"Omerta"=>"Omertà",
|
||||
"opera bouffe"=>"opéra bouffe",
|
||||
"Opera bouffe"=>"Opéra bouffe",
|
||||
"opera comique"=>"opéra comique",
|
||||
"Opera comique"=>"Opéra comique",
|
||||
"outre"=>"outré",
|
||||
"Outre"=>"Outré",
|
||||
"papier-mache"=>"papier-mâché",
|
||||
"Papier-mache"=>"Papier-mâché",
|
||||
"passe"=>"passé",
|
||||
"Passe"=>"Passé",
|
||||
"pho"=>"phở",
|
||||
"Pho"=>"Phở",
|
||||
"piece de resistance"=>"pièce de résistance",
|
||||
"Piece de resistance"=>"Pièce de résistance",
|
||||
"pied-a-terre"=>"pied-à-terre",
|
||||
"Pied-a-terre"=>"Pied-à-terre",
|
||||
"plisse"=>"plissé",
|
||||
"Plisse"=>"Plissé",
|
||||
"pina colada"=>"piña colada",
|
||||
"Pina colada"=>"Piña colada",
|
||||
"pinata"=>"piñata",
|
||||
"Pinata"=>"Piñata",
|
||||
"pinon"=>"piñón",
|
||||
"Pinon"=>"Piñón",
|
||||
"pirana"=>"piraña",
|
||||
"Pirana"=>"Piraña",
|
||||
"pique"=>"piqué",
|
||||
"Pique"=>"Piqué",
|
||||
"piu"=>"più",
|
||||
"Piu"=>"Più",
|
||||
"plie"=>"plié",
|
||||
"Plie"=>"Plié",
|
||||
"precis"=>"précis",
|
||||
"Precis"=>"Précis",
|
||||
"polsa"=>"pölsa",
|
||||
"Polsa"=>"Pölsa",
|
||||
"premiere"=>"première",
|
||||
"Premiere"=>"Première",
|
||||
"pret-a-porter"=>"prêt-à-porter",
|
||||
"Pret-a-porter"=>"Prêt-à-porter",
|
||||
"protege"=>"protégé",
|
||||
"Protege"=>"Protégé",
|
||||
"protegee"=>"protégée",
|
||||
"Protegee"=>"Protégée",
|
||||
"puree"=>"purée",
|
||||
"Puree"=>"Purée",
|
||||
"Quebecois"=>"Québécois",
|
||||
"raison d'etre"=>"raison d'être",
|
||||
"Raison d'etre"=>"Raison d'être",
|
||||
"recherche"=>"recherché",
|
||||
"Recherche"=>"Recherché",
|
||||
"reclame"=>"réclame",
|
||||
"Reclame"=>"Réclame",
|
||||
"regime"=>"régime",
|
||||
"Regime"=>"Régime",
|
||||
"retrousse"=>"retroussé",
|
||||
"Retrousse"=>"Retroussé",
|
||||
"risque"=>"risqué",
|
||||
"Risque"=>"Risqué",
|
||||
"riviere"=>"rivière",
|
||||
"Riviere"=>"Rivière",
|
||||
"roman a clef"=>"roman à clef",
|
||||
"Roman a clef"=>"Roman à clef",
|
||||
"roue"=>"roué",
|
||||
"Roue"=>"Roué",
|
||||
"saute"=>"sauté",
|
||||
"Saute"=>"Sauté",
|
||||
"seance"=>"séance",
|
||||
"Seance"=>"Séance",
|
||||
"senor"=>"señor",
|
||||
"Senor"=>"Señor",
|
||||
"senora"=>"señora",
|
||||
"Senora"=>"Señora",
|
||||
"senorita"=>"señorita",
|
||||
"Senorita"=>"Señorita",
|
||||
"Sinn Fein"=>"Sinn Féin",
|
||||
"smorgasbord"=>"smörgåsbord",
|
||||
"Smorgasbord"=>"Smörgåsbord",
|
||||
"smorgastarta"=>"smörgåstårta",
|
||||
"Smorgastarta"=>"Smörgåstårta",
|
||||
"soigne"=>"soigné",
|
||||
"Soigne"=>"Soigné",
|
||||
"soiree"=>"soirée",
|
||||
"Soiree"=>"Soirée",
|
||||
"souffle"=>"soufflé",
|
||||
"Souffle"=>"Soufflé",
|
||||
"soupcon"=>"soupçon",
|
||||
"Soupcon"=>"Soupçon",
|
||||
"surstromming"=>"surströmming",
|
||||
"Surstromming"=>"Surströmming",
|
||||
"tete-a-tete"=>"tête-à-tête",
|
||||
"Tete-a-tete"=>"Tête-à-tête",
|
||||
"touche"=>"touché",
|
||||
"Touche"=>"Touché",
|
||||
"tourtiere"=>"tourtière",
|
||||
"Tourtiere"=>"Tourtière",
|
||||
"Zaire"=>"Zaïre",
|
||||
);
|
||||
429
site/OFF_plugins/typography/php-typography/diacritics/en-US.php
Normal file
429
site/OFF_plugins/typography/php-typography/diacritics/en-US.php
Normal file
|
|
@ -0,0 +1,429 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Language: English (United States)
|
||||
*
|
||||
* An array of all words containing diacritics (and their non-diacritic
|
||||
* alternatives that should be replaced), provided a legitimate English
|
||||
* word does not exist without such diacritic characters (i.e.
|
||||
* divorcé & divorce, exposé & expose, résumé & resume ).
|
||||
*
|
||||
* In the form of $diacriticWords = array( key => value );
|
||||
* where "key" is the needle and "value" is the replacement
|
||||
*
|
||||
* @package wpTypography
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
$diacriticLanguage = 'English (United States)';
|
||||
|
||||
$diacritic_words = array(
|
||||
"a bas"=>"à bas",
|
||||
"A bas"=>"À bas",
|
||||
"a la"=>"à la",
|
||||
"A la"=>"À la",
|
||||
"a la carte"=>"à la carte",
|
||||
"A la carte"=>"À la carte",
|
||||
"a la mode"=>"à la mode",
|
||||
"A la mode"=>"À la mode",
|
||||
"a gogo"=>"à gogo",
|
||||
"A gogo"=>"À gogo",
|
||||
"ago-go"=>"àgo-go",
|
||||
"Ago-go"=>"Àgo-go",
|
||||
"abbe"=>"abbé",
|
||||
"Abbe"=>"Abbé",
|
||||
"adios"=>"adiós",
|
||||
"Adios"=>"Adiós",
|
||||
"agrement"=>"agrément",
|
||||
"Agrement"=>"Agrément",
|
||||
"anime"=>"animé",
|
||||
"Anime"=>"Animé",
|
||||
"Ancien Regime"=>"Ancien Régime",
|
||||
"angstrom"=>"ångström",
|
||||
"Angstrom"=>"Ångström",
|
||||
"anu"=>"añu",
|
||||
"Anu"=>"Añu",
|
||||
"ao dai"=>"áo dài",
|
||||
"Ao dai"=>"Áo dài",
|
||||
"aperitif"=>"apéritif",
|
||||
"Aperitif"=>"Apéritif",
|
||||
"applique"=>"appliqué",
|
||||
"Applique"=>"Appliqué",
|
||||
"apres-ski"=>"après-ski",
|
||||
"Apres-ski"=>"Après-ski",
|
||||
"arete"=>"arête",
|
||||
"Arete"=>"Arête",
|
||||
"attache"=>"attaché",
|
||||
"Attache"=>"Attaché",
|
||||
"auto-da-fe"=>"auto-da-fé",
|
||||
"Auto-da-fe"=>"Auto-da-fé",
|
||||
"acaí"=>"açaí",
|
||||
"Acaí"=>"Açaí",
|
||||
"belle epoque"=>"belle époque",
|
||||
"Belle epoque"=>"Belle époque",
|
||||
"bete noire"=>"bête noire",
|
||||
"Bete noire"=>"Bête noire",
|
||||
"betise"=>"bêtise",
|
||||
"Betise"=>"Bêtise",
|
||||
"blase"=>"blasé",
|
||||
"Blase"=>"Blasé",
|
||||
"boite"=>"boîte",
|
||||
"Boite"=>"Boîte",
|
||||
"Bon"=>"Bön",
|
||||
"Bootes"=>"Boötes",
|
||||
"boutonniere"=>"boutonnière",
|
||||
"Boutonniere"=>"Boutonnière",
|
||||
"bric-a-brac"=>"bric-à-brac",
|
||||
"Bric-a-brac"=>"Bric-à-brac",
|
||||
"cafe"=>"café",
|
||||
"Cafe"=>"Café",
|
||||
"canape"=>"canapé",
|
||||
"Canape"=>"Canapé",
|
||||
"Champs-Elysees"=>"Champs-Élysées",
|
||||
"chateau"=>"château",
|
||||
"Chateau"=>"Château",
|
||||
"charge d'affaires"=>"chargé d'affaires",
|
||||
"Charge d'affaires"=>"Chargé d'affaires",
|
||||
"cause celebre"=>"cause célèbre",
|
||||
"Cause celebre"=>"Cause célèbre",
|
||||
"chaines"=>"chaînés",
|
||||
"Chaines"=>"Chaînés",
|
||||
"cinema verite"=>"cinéma vérité",
|
||||
"Cinema verite"=>"Cinéma vérité",
|
||||
"cliche"=>"cliché",
|
||||
"Cliche"=>"Cliché",
|
||||
"cloisonne"=>"cloisonné",
|
||||
"Cloisonne"=>"Cloisonné",
|
||||
"consomme"=>"consommé",
|
||||
"Consomme"=>"Consommé",
|
||||
"communique"=>"communiqué",
|
||||
"Communique"=>"Communiqué",
|
||||
"confrere"=>"confrère",
|
||||
"Confrere"=>"Confrère",
|
||||
"coopt"=>"coöpt",
|
||||
"Coopt"=>"Coöpt",
|
||||
"cortege"=>"cortège",
|
||||
"Cortege"=>"Cortège",
|
||||
"coup d'etat"=>"coup d'état",
|
||||
"Coup d'etat"=>"Coup d'état",
|
||||
"coup de grace"=>"coup de grâce",
|
||||
"Coup de grace"=>"Coup de grâce",
|
||||
"creche"=>"crèche",
|
||||
"Creche"=>"Crèche",
|
||||
"coulee"=>"coulée",
|
||||
"Coulee"=>"Coulée",
|
||||
"creme brulee"=>"crème brûlée",
|
||||
"Creme brulee"=>"Crème brûlée",
|
||||
"creme fraiche"=>"crème fraîche",
|
||||
"Creme fraiche"=>"Crème fraîche",
|
||||
"creme"=>"crème",
|
||||
"Creme"=>"Crème",
|
||||
"crepe"=>"crêpe",
|
||||
"Crepe"=>"Crêpe",
|
||||
"Creusa"=>"Creüsa",
|
||||
"crouton"=>"croûton",
|
||||
"Crouton"=>"Croûton",
|
||||
"crudites"=>"crudités",
|
||||
"Crudites"=>"Crudités",
|
||||
"Curacao"=>"Curaçao",
|
||||
"dais"=>"daïs",
|
||||
"Dais"=>"Daïs",
|
||||
"dau hoi"=>"dấu hỏi",
|
||||
"Dau hoi"=>"Dấu hỏi",
|
||||
"debutante"=>"débutante",
|
||||
"Debutante"=>"Débutante",
|
||||
"declasse"=>"déclassé",
|
||||
"Declasse"=>"Déclassé",
|
||||
"decolletage"=>"décolletage",
|
||||
"Decolletage"=>"Décolletage",
|
||||
"decollete"=>"décolleté",
|
||||
"Decollete"=>"Décolleté",
|
||||
"decor"=>"décor",
|
||||
"Decor"=>"Décor",
|
||||
"decoupage"=>"découpage",
|
||||
"Decoupage"=>"Découpage",
|
||||
"degage"=>"dégagé",
|
||||
"Degage"=>"Dégagé",
|
||||
"deja vu"=>"déjà vu",
|
||||
"Deja vu"=>"Déjà vu",
|
||||
"demode"=>"démodé",
|
||||
"Demode"=>"Démodé",
|
||||
"denouement"=>"dénouement",
|
||||
"Denouement"=>"Dénouement",
|
||||
"derailleur"=>"dérailleur",
|
||||
"Derailleur"=>"Dérailleur",
|
||||
"derriere"=>"derrière",
|
||||
"Derriere"=>"Derrière",
|
||||
"deshabille"=>"déshabillé",
|
||||
"Deshabille"=>"Déshabillé",
|
||||
"detente"=>"détente",
|
||||
"Detente"=>"Détente",
|
||||
"diamante"=>"diamanté",
|
||||
"Diamante"=>"Diamanté",
|
||||
"discotheque"=>"discothèque",
|
||||
"Discotheque"=>"Discothèque",
|
||||
"doppelganger"=>"doppelgänger",
|
||||
"Doppelganger"=>"Doppelgänger",
|
||||
"eclair"=>"éclair",
|
||||
"Eclair"=>"Éclair",
|
||||
"eclat"=>"éclat",
|
||||
"Eclat"=>"Éclat",
|
||||
"Eire"=>"Éire",
|
||||
"El Nino"=>"El Niño",
|
||||
"elan"=>"élan",
|
||||
"Elan"=>"Élan",
|
||||
"emigre"=>"émigré",
|
||||
"Emigre"=>"Émigré",
|
||||
"entree"=>"entrée",
|
||||
"Entree"=>"Entrée",
|
||||
"entrepot"=>"entrepôt",
|
||||
"Entrepot"=>"Entrepôt",
|
||||
"entrecote"=>"entrecôte",
|
||||
"Entrecote"=>"Entrecôte",
|
||||
"epee"=>"épée",
|
||||
"Epee"=>"Épée",
|
||||
"etouffee"=>"étouffée",
|
||||
"Etouffee"=>"Étouffée",
|
||||
"etude"=>"étude",
|
||||
"Etude"=>"Étude",
|
||||
"facade"=>"façade",
|
||||
"Facade"=>"Façade",
|
||||
"fete"=>"fête",
|
||||
"Fete"=>"Fête",
|
||||
"faience"=>"faïence",
|
||||
"Faience"=>"Faïence",
|
||||
"fiance"=>"fiancé",
|
||||
"Fiance"=>"Fiancé",
|
||||
"fiancee"=>"fiancée",
|
||||
"Fiancee"=>"Fiancée",
|
||||
"filmjolk"=>"filmjölk",
|
||||
"Filmjolk"=>"Filmjölk",
|
||||
"fin de siecle"=>"fin de siècle",
|
||||
"Fin de siecle"=>"Fin de siècle",
|
||||
"flambe"=>"flambé",
|
||||
"Flambe"=>"Flambé",
|
||||
"fleche"=>"flèche",
|
||||
"Fleche"=>"Flèche",
|
||||
"fohn wind"=>"föhn wind",
|
||||
"Fohn wind"=>"Föhn wind",
|
||||
"folie a deux"=>"folie à deux",
|
||||
"Folie a deux"=>"Folie à deux",
|
||||
"fouette"=>"fouetté",
|
||||
"Fouette"=>"Fouetté",
|
||||
"frappe"=>"frappé",
|
||||
"Frappe"=>"Frappé",
|
||||
"fraulein"=>"fräulein",
|
||||
"Fraulein"=>"Fräulein",
|
||||
"Fuhrer"=>"Führer",
|
||||
"garcon"=>"garçon",
|
||||
"Garcon"=>"Garçon",
|
||||
"gateau"=>"gâteau",
|
||||
"Gateau"=>"Gâteau",
|
||||
"gemutlichkeit"=>"gemütlichkeit",
|
||||
"Gemutlichkeit"=>"Gemütlichkeit",
|
||||
"glace"=>"glacé",
|
||||
"Glace"=>"Glacé",
|
||||
"glogg"=>"glögg",
|
||||
"Glogg"=>"Glögg",
|
||||
"Gewurztraminer"=>"Gewürztraminer",
|
||||
"Gotterdammerung"=>"Götterdämmerung",
|
||||
"Grafenberg spot"=>"Gräfenberg spot",
|
||||
"gruyere"=>"gruyère",
|
||||
"Gruyere"=>"Gruyère",
|
||||
"habitue"=>"habitué",
|
||||
"Habitue"=>"Habitué",
|
||||
"hacek"=>"háček",
|
||||
"Hacek"=>"Háček",
|
||||
"hors d’oeuvre"=>"hors d’œuvre",
|
||||
"Hors d’oeuvre"=>"Hors d’œuvre",
|
||||
"ingenue"=>"ingénue",
|
||||
"Ingenue"=>"Ingénue",
|
||||
"jager"=>"jäger",
|
||||
"Jager"=>"Jäger",
|
||||
"jalapeno"=>"jalapeño",
|
||||
"Jalapeno"=>"Jalapeño",
|
||||
"jardiniere"=>"jardinière",
|
||||
"Jardiniere"=>"Jardinière",
|
||||
"krouzek"=>"kroužek",
|
||||
"Krouzek"=>"Kroužek",
|
||||
"kummel"=>"kümmel",
|
||||
"Kummel"=>"Kümmel",
|
||||
"kaldolmar"=>"kåldolmar",
|
||||
"Kaldolmar"=>"Kåldolmar",
|
||||
"karaoke"=>"karaōke",
|
||||
"Karaoke"=>"Karaōke",
|
||||
"landler"=>"ländler",
|
||||
"Landler"=>"Ländler",
|
||||
"langue d'oil"=>"langue d'oïl",
|
||||
"Langue d'oil"=>"Langue d'oïl",
|
||||
"La Nina"=>"La Niña",
|
||||
"litterateur"=>"littérateur",
|
||||
"Litterateur"=>"Littérateur",
|
||||
"lycee"=>"lycée",
|
||||
"Lycee"=>"Lycée",
|
||||
"macedoine"=>"macédoine",
|
||||
"Macedoine"=>"Macédoine",
|
||||
"macrame"=>"macramé",
|
||||
"Macrame"=>"Macramé",
|
||||
"maitre d'hotel"=>"maître d'hôtel",
|
||||
"Maitre d'hotel"=>"Maître d'hôtel",
|
||||
"malaguena"=>"malagueña",
|
||||
"Malaguena"=>"Malagueña",
|
||||
"manana"=>"mañana",
|
||||
"Manana"=>"Mañana",
|
||||
"manege"=>"manège",
|
||||
"Manege"=>"Manège",
|
||||
"manoeuvre"=>"manœuvre",
|
||||
"Manoeuvre"=>"Manœuvre",
|
||||
"manque"=>"manqué",
|
||||
"Manque"=>"Manqué",
|
||||
"materiel"=>"matériel",
|
||||
"Materiel"=>"Matériel",
|
||||
"matinee"=>"matinée",
|
||||
"Matinee"=>"Matinée",
|
||||
"melange"=>"mélange",
|
||||
"Melange"=>"Mélange",
|
||||
"melee"=>"mêlée",
|
||||
"Melee"=>"Mêlée",
|
||||
"menage a trois"=>"ménage à trois",
|
||||
"Menage a trois"=>"Ménage à trois",
|
||||
"mesalliance"=>"mésalliance",
|
||||
"Mesalliance"=>"Mésalliance",
|
||||
"metier"=>"métier",
|
||||
"Metier"=>"Métier",
|
||||
"Metis"=>"Métis",
|
||||
"minaudiere"=>"minaudière",
|
||||
"Minaudiere"=>"Minaudière",
|
||||
"moire"=>"moiré",
|
||||
"Moire"=>"Moiré",
|
||||
"Montreal"=>"Montréal",
|
||||
"naif"=>"naïf",
|
||||
"Naif"=>"Naïf",
|
||||
"naive"=>"naïve",
|
||||
"Naive"=>"Naïve",
|
||||
"naivete"=>"naïveté",
|
||||
"Naivete"=>"Naïveté",
|
||||
"ne"=>"né",
|
||||
"Ne"=>"Né",
|
||||
"nee"=>"née",
|
||||
"Nee"=>"Née",
|
||||
"negligee"=>"négligée",
|
||||
"Negligee"=>"Négligée",
|
||||
"Neufchatel"=>"Neufchâtel",
|
||||
"Nez Perce"=>"Nez Percé",
|
||||
"Noel"=>"Noël",
|
||||
"numero uno"=>"número uno",
|
||||
"Numero uno"=>"Número uno",
|
||||
"Montano"=>"Montaño",
|
||||
"objet trouve"=>"objet trouvé",
|
||||
"Objet trouve"=>"Objet trouvé",
|
||||
"ole"=>"olé",
|
||||
"Ole"=>"Olé",
|
||||
"ombre"=>"ombré",
|
||||
"Ombre"=>"Ombré",
|
||||
"omerta"=>"omertà",
|
||||
"Omerta"=>"Omertà",
|
||||
"opera bouffe"=>"opéra bouffe",
|
||||
"Opera bouffe"=>"Opéra bouffe",
|
||||
"opera comique"=>"opéra comique",
|
||||
"Opera comique"=>"Opéra comique",
|
||||
"outre"=>"outré",
|
||||
"Outre"=>"Outré",
|
||||
"papier-mache"=>"papier-mâché",
|
||||
"Papier-mache"=>"Papier-mâché",
|
||||
"passe"=>"passé",
|
||||
"Passe"=>"Passé",
|
||||
"pate"=>"pâté",
|
||||
"Pate"=>"Pâté",
|
||||
"pho"=>"phở",
|
||||
"Pho"=>"Phở",
|
||||
"piece de resistance"=>"pièce de résistance",
|
||||
"Piece de resistance"=>"Pièce de résistance",
|
||||
"pied-a-terre"=>"pied-à-terre",
|
||||
"Pied-a-terre"=>"Pied-à-terre",
|
||||
"plisse"=>"plissé",
|
||||
"Plisse"=>"Plissé",
|
||||
"pina colada"=>"piña colada",
|
||||
"Pina colada"=>"Piña colada",
|
||||
"pinata"=>"piñata",
|
||||
"Pinata"=>"Piñata",
|
||||
"pinon"=>"piñón",
|
||||
"Pinon"=>"Piñón",
|
||||
"pirana"=>"piraña",
|
||||
"Pirana"=>"Piraña",
|
||||
"pique"=>"piqué",
|
||||
"Pique"=>"Piqué",
|
||||
"piu"=>"più",
|
||||
"Piu"=>"Più",
|
||||
"plie"=>"plié",
|
||||
"Plie"=>"Plié",
|
||||
"precis"=>"précis",
|
||||
"Precis"=>"Précis",
|
||||
"polsa"=>"pölsa",
|
||||
"Polsa"=>"Pölsa",
|
||||
"premiere"=>"première",
|
||||
"Premiere"=>"Première",
|
||||
"pret-a-porter"=>"prêt-à-porter",
|
||||
"Pret-a-porter"=>"Prêt-à-porter",
|
||||
"protege"=>"protégé",
|
||||
"Protege"=>"Protégé",
|
||||
"protegee"=>"protégée",
|
||||
"Protegee"=>"Protégée",
|
||||
"puree"=>"purée",
|
||||
"Puree"=>"Purée",
|
||||
"Quebecois"=>"Québécois",
|
||||
"raison d'etre"=>"raison d'être",
|
||||
"Raison d'etre"=>"Raison d'être",
|
||||
"recherche"=>"recherché",
|
||||
"Recherche"=>"Recherché",
|
||||
"reclame"=>"réclame",
|
||||
"Reclame"=>"Réclame",
|
||||
"regime"=>"régime",
|
||||
"Regime"=>"Régime",
|
||||
"retrousse"=>"retroussé",
|
||||
"Retrousse"=>"Retroussé",
|
||||
"risque"=>"risqué",
|
||||
"Risque"=>"Risqué",
|
||||
"riviere"=>"rivière",
|
||||
"Riviere"=>"Rivière",
|
||||
"roman a clef"=>"roman à clef",
|
||||
"Roman a clef"=>"Roman à clef",
|
||||
"roue"=>"roué",
|
||||
"Roue"=>"Roué",
|
||||
"saute"=>"sauté",
|
||||
"Saute"=>"Sauté",
|
||||
"seance"=>"séance",
|
||||
"Seance"=>"Séance",
|
||||
"senor"=>"señor",
|
||||
"Senor"=>"Señor",
|
||||
"senora"=>"señora",
|
||||
"Senora"=>"Señora",
|
||||
"senorita"=>"señorita",
|
||||
"Senorita"=>"Señorita",
|
||||
"Sinn Fein"=>"Sinn Féin",
|
||||
"smorgasbord"=>"smörgåsbord",
|
||||
"Smorgasbord"=>"Smörgåsbord",
|
||||
"smorgastarta"=>"smörgåstårta",
|
||||
"Smorgastarta"=>"Smörgåstårta",
|
||||
"soigne"=>"soigné",
|
||||
"Soigne"=>"Soigné",
|
||||
"soiree"=>"soirée",
|
||||
"Soiree"=>"Soirée",
|
||||
"souffle"=>"soufflé",
|
||||
"Souffle"=>"Soufflé",
|
||||
"soupcon"=>"soupçon",
|
||||
"Soupcon"=>"Soupçon",
|
||||
"surstromming"=>"surströmming",
|
||||
"Surstromming"=>"Surströmming",
|
||||
"tete-a-tete"=>"tête-à-tête",
|
||||
"Tete-a-tete"=>"Tête-à-tête",
|
||||
"touche"=>"touché",
|
||||
"Touche"=>"Touché",
|
||||
"tourtiere"=>"tourtière",
|
||||
"Tourtiere"=>"Tourtière",
|
||||
"uber"=>"über",
|
||||
"Uber"=>"Über",
|
||||
"Ubermensch"=>"Übermensch",
|
||||
"Zaire"=>"Zaïre",
|
||||
);
|
||||
|
||||
10577
site/OFF_plugins/typography/php-typography/lang/af.php
Normal file
10577
site/OFF_plugins/typography/php-typography/lang/af.php
Normal file
File diff suppressed because it is too large
Load diff
1741
site/OFF_plugins/typography/php-typography/lang/bg.php
Normal file
1741
site/OFF_plugins/typography/php-typography/lang/bg.php
Normal file
File diff suppressed because it is too large
Load diff
1057
site/OFF_plugins/typography/php-typography/lang/ca.php
Normal file
1057
site/OFF_plugins/typography/php-typography/lang/ca.php
Normal file
File diff suppressed because it is too large
Load diff
3766
site/OFF_plugins/typography/php-typography/lang/cs.php
Normal file
3766
site/OFF_plugins/typography/php-typography/lang/cs.php
Normal file
File diff suppressed because it is too large
Load diff
6790
site/OFF_plugins/typography/php-typography/lang/cy.php
Normal file
6790
site/OFF_plugins/typography/php-typography/lang/cy.php
Normal file
File diff suppressed because it is too large
Load diff
1256
site/OFF_plugins/typography/php-typography/lang/da.php
Normal file
1256
site/OFF_plugins/typography/php-typography/lang/da.php
Normal file
File diff suppressed because it is too large
Load diff
15691
site/OFF_plugins/typography/php-typography/lang/de-1901.php
Normal file
15691
site/OFF_plugins/typography/php-typography/lang/de-1901.php
Normal file
File diff suppressed because it is too large
Load diff
15274
site/OFF_plugins/typography/php-typography/lang/de.php
Normal file
15274
site/OFF_plugins/typography/php-typography/lang/de.php
Normal file
File diff suppressed because it is too large
Load diff
645
site/OFF_plugins/typography/php-typography/lang/el-Mono.php
Normal file
645
site/OFF_plugins/typography/php-typography/lang/el-Mono.php
Normal file
|
|
@ -0,0 +1,645 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Project: wp-Typography
|
||||
Project URI: https://code.mundschenk.at/wp-typography/
|
||||
|
||||
File modified to place pattern and exceptions in arrays that can be understood in php files.
|
||||
This file is released under the same copyright as the below referenced original file
|
||||
Original unmodified file is available at: http://ctan.mirrorcatalogs.com/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex
|
||||
Original file name: hyph-el-monoton.tex
|
||||
|
||||
//============================================================================================================
|
||||
ORIGINAL FILE INFO
|
||||
|
||||
% ****************************************************************
|
||||
%
|
||||
% File name: hyph-el-monoton.tex
|
||||
%
|
||||
% Created: June 6, 2008
|
||||
% Last modified: Sept. 12, 2011
|
||||
%
|
||||
% Unicode hyphenation patterns for Modern Monotonic (single accent)
|
||||
% Greek.
|
||||
%
|
||||
% Author: Dimitrios Filippou, (c) 2008-2011
|
||||
% Licence: LaTeX Project Public Licence
|
||||
%
|
||||
% This file was first created by mechanical translation from
|
||||
% GRMhyph5.tex via "elhyph-utf8 -m -c" (version 0.1 by Peter
|
||||
% Heslin -- p.j.heslin at durham dot ac dot uk). Some additions
|
||||
% were also made by hand.
|
||||
%
|
||||
% Created by Dimitrios Filippou with some ideas borrowed from
|
||||
% Yannis Haralambous, Kostis Dryllerakis and Claudio Beccari.
|
||||
% Mojca Miklavec adapted it for the "hyph-utf8" package.
|
||||
%
|
||||
% These hyphenation patterns are explained in "modern.pdf", which
|
||||
% can be found in the "elhyphen" or "hyphenation-greek" package.
|
||||
%
|
||||
% Documentation in English can be found in: D. Filippou,
|
||||
% "Hyphenation patterns for Ancient and Modern Greek," in
|
||||
% "TeX, XML, and Digital Typography" (A. Syropoulos et al.,
|
||||
% eds.), Lecture Notes in Computer Science 3130, Springer-Verlag
|
||||
% Berlin-Heidelberg, 2004. ISBN 3-540-22801-2.
|
||||
%
|
||||
% ****************************************************************
|
||||
%
|
||||
% \message{UTF-8 hyphenation patterns for Modern, Monotonic Greek}
|
||||
%
|
||||
|
||||
|
||||
//============================================================================================================
|
||||
|
||||
*/
|
||||
|
||||
$patgenLanguage = 'Greek (Modern Monotonic)';
|
||||
|
||||
$patgenExceptions = array();
|
||||
|
||||
$patgenMaxSeg = 4;
|
||||
|
||||
$patgen = array(
|
||||
'begin' => array(
|
||||
'ι' => '03',
|
||||
'ί' => '03',
|
||||
'ί' => '03',
|
||||
'η' => '03',
|
||||
'ή' => '03',
|
||||
'ή' => '03',
|
||||
'υ' => '03',
|
||||
'ύ' => '03',
|
||||
'ύ' => '03',
|
||||
'β' => '04',
|
||||
'γ' => '04',
|
||||
'δ' => '04',
|
||||
'ζ' => '04',
|
||||
'θ' => '04',
|
||||
'κ' => '04',
|
||||
'λ' => '04',
|
||||
'μ' => '04',
|
||||
'ν' => '04',
|
||||
'ξ' => '04',
|
||||
'π' => '04',
|
||||
'ρ' => '04',
|
||||
'σ' => '04',
|
||||
'ϲ' => '04',
|
||||
'τ' => '04',
|
||||
'φ' => '04',
|
||||
'χ' => '04',
|
||||
'ψ' => '04',
|
||||
),
|
||||
|
||||
'end' => array(
|
||||
'άη' => '030',
|
||||
'άη' => '030',
|
||||
'άι' => '030',
|
||||
'άι' => '030',
|
||||
'όη' => '030',
|
||||
'όη' => '030',
|
||||
'όι' => '030',
|
||||
'όι' => '030',
|
||||
'β' => '40',
|
||||
'γ' => '40',
|
||||
'γκ' => '400',
|
||||
'δ' => '40',
|
||||
'ζ' => '40',
|
||||
'θ' => '40',
|
||||
'κ' => '40',
|
||||
'λ' => '40',
|
||||
'μ' => '40',
|
||||
'μπ' => '400',
|
||||
'ν' => '40',
|
||||
'ντ' => '400',
|
||||
'ξ' => '40',
|
||||
'π' => '40',
|
||||
'ρ' => '40',
|
||||
'σ' => '40',
|
||||
'ϲ' => '40',
|
||||
'ς' => '40',
|
||||
'τ' => '40',
|
||||
'τζ' => '400',
|
||||
'τσ' => '400',
|
||||
'τϲ' => '400',
|
||||
'τς' => '400',
|
||||
'φ' => '40',
|
||||
'χ' => '40',
|
||||
'ψ' => '40',
|
||||
'βρ' => '400',
|
||||
'γλ' => '400',
|
||||
'κλ' => '400',
|
||||
'κτ' => '400',
|
||||
'γκς' => '4000',
|
||||
'γκϲ' => '4000',
|
||||
'γκσ' => '4000',
|
||||
'κς' => '600',
|
||||
'κϲ' => '600',
|
||||
'κσ' => '400',
|
||||
'λς' => '400',
|
||||
'λϲ' => '400',
|
||||
'λσ' => '400',
|
||||
'μπλ' => '4000',
|
||||
'μπν' => '4000',
|
||||
'μπρ' => '4000',
|
||||
'μς' => '400',
|
||||
'μϲ' => '400',
|
||||
'μσ' => '400',
|
||||
'νς' => '400',
|
||||
'νϲ' => '400',
|
||||
'νσ' => '400',
|
||||
'ρς' => '400',
|
||||
'ρϲ' => '400',
|
||||
'ρσ' => '400',
|
||||
'σκ' => '400',
|
||||
'ϲκ' => '400',
|
||||
'στ' => '400',
|
||||
'ϲτ' => '400',
|
||||
'τλ' => '400',
|
||||
'τρ' => '400',
|
||||
'ντς' => '4000',
|
||||
'ντϲ' => '4000',
|
||||
'ντσ' => '4000',
|
||||
'φτ' => '400',
|
||||
'χτ' => '400',
|
||||
),
|
||||
|
||||
'all' => array(
|
||||
'α' => '01',
|
||||
'ε' => '01',
|
||||
'η' => '01',
|
||||
'ι' => '01',
|
||||
'ο' => '01',
|
||||
'υ' => '01',
|
||||
'ω' => '01',
|
||||
'ϊ' => '01',
|
||||
'ϋ' => '01',
|
||||
'ά' => '01',
|
||||
'έ' => '01',
|
||||
'ή' => '01',
|
||||
'ί' => '01',
|
||||
'ό' => '01',
|
||||
'ύ' => '01',
|
||||
'ώ' => '01',
|
||||
'ΐ' => '01',
|
||||
'ΰ' => '01',
|
||||
'αι' => '020',
|
||||
'αί' => '020',
|
||||
'αί' => '020',
|
||||
'άι' => '020',
|
||||
'άι' => '020',
|
||||
'άϊ' => '020',
|
||||
'άϊ' => '020',
|
||||
'αυ' => '020',
|
||||
'αύ' => '020',
|
||||
'αύ' => '020',
|
||||
'άυ' => '030',
|
||||
'άυ' => '030',
|
||||
'ει' => '020',
|
||||
'εί' => '020',
|
||||
'εί' => '020',
|
||||
'έι' => '020',
|
||||
'έι' => '020',
|
||||
'έϊ' => '020',
|
||||
'έϊ' => '020',
|
||||
'ευ' => '020',
|
||||
'εύ' => '020',
|
||||
'εύ' => '020',
|
||||
'έυ' => '030',
|
||||
'έυ' => '030',
|
||||
'ηυ' => '020',
|
||||
'ηύ' => '020',
|
||||
'ηύ' => '020',
|
||||
'ήυ' => '030',
|
||||
'ήυ' => '030',
|
||||
'οι' => '020',
|
||||
'οί' => '020',
|
||||
'οί' => '020',
|
||||
'όι' => '020',
|
||||
'όι' => '020',
|
||||
'όϊ' => '020',
|
||||
'όϊ' => '020',
|
||||
'ου' => '020',
|
||||
'ού' => '020',
|
||||
'ού' => '020',
|
||||
'όυ' => '030',
|
||||
'όυ' => '030',
|
||||
'υι' => '020',
|
||||
'υί' => '020',
|
||||
'υί' => '020',
|
||||
'ύι' => '030',
|
||||
'ύι' => '030',
|
||||
'αη' => '020',
|
||||
'αϊ' => '020',
|
||||
'αϋ' => '020',
|
||||
'εϊ' => '020',
|
||||
'εϋ' => '020',
|
||||
'οει' => '0200',
|
||||
'οη' => '020',
|
||||
'οϊ' => '020',
|
||||
'ια' => '020',
|
||||
'ιά' => '020',
|
||||
'ιά' => '020',
|
||||
'ιε' => '020',
|
||||
'ιέ' => '020',
|
||||
'ιέ' => '020',
|
||||
'ιο' => '020',
|
||||
'ιό' => '020',
|
||||
'ιό' => '020',
|
||||
'οϊό' => '0330',
|
||||
'οϊό' => '0330',
|
||||
'ιω' => '020',
|
||||
'ιώ' => '020',
|
||||
'ιώ' => '020',
|
||||
'ηα' => '020',
|
||||
'ηά' => '020',
|
||||
'ηά' => '020',
|
||||
'ηε' => '020',
|
||||
'ηέ' => '020',
|
||||
'ηέ' => '020',
|
||||
'ηο' => '020',
|
||||
'ηό' => '020',
|
||||
'ηό' => '020',
|
||||
'ηω' => '020',
|
||||
'ηώ' => '020',
|
||||
'ηώ' => '020',
|
||||
'υα' => '020',
|
||||
'υά' => '020',
|
||||
'υά' => '020',
|
||||
'υο' => '020',
|
||||
'υό' => '020',
|
||||
'υό' => '020',
|
||||
'υω' => '020',
|
||||
'υώ' => '020',
|
||||
'υώ' => '020',
|
||||
'\'' => '40',
|
||||
'ʼ' => '40',
|
||||
'᾿' => '40',
|
||||
'β\'' => '400',
|
||||
'βʼ' => '400',
|
||||
'β᾿' => '400',
|
||||
'γ\'' => '400',
|
||||
'γʼ' => '400',
|
||||
'γ᾿' => '400',
|
||||
'δ\'' => '400',
|
||||
'δʼ' => '400',
|
||||
'δ᾿' => '400',
|
||||
'ζ\'' => '400',
|
||||
'ζʼ' => '400',
|
||||
'ζ᾿' => '400',
|
||||
'θ\'' => '400',
|
||||
'θʼ' => '400',
|
||||
'θ᾿' => '400',
|
||||
'κ\'' => '400',
|
||||
'κʼ' => '400',
|
||||
'κ᾿' => '400',
|
||||
'λ\'' => '400',
|
||||
'λʼ' => '400',
|
||||
'λ᾿' => '400',
|
||||
'μ\'' => '400',
|
||||
'μʼ' => '400',
|
||||
'μ᾿' => '400',
|
||||
'μπ\'' => '4000',
|
||||
'μπʼ' => '4000',
|
||||
'μπ᾿' => '4000',
|
||||
'ν\'' => '400',
|
||||
'νʼ' => '400',
|
||||
'ν᾿' => '400',
|
||||
'ντ\'' => '4000',
|
||||
'ντ’' => '4000',
|
||||
'ντ᾿' => '4000',
|
||||
'ξ\'' => '400',
|
||||
'ξʼ' => '400',
|
||||
'ξ᾿' => '400',
|
||||
'π\'' => '400',
|
||||
'πʼ' => '400',
|
||||
'π᾿' => '400',
|
||||
'ρ\'' => '400',
|
||||
'ρʼ' => '400',
|
||||
'ρ᾿' => '400',
|
||||
'σ\'' => '400',
|
||||
'σʼ' => '400',
|
||||
'σ᾿' => '400',
|
||||
'ϲ\'' => '400',
|
||||
'ϲʼ' => '400',
|
||||
'ϲ᾿' => '400',
|
||||
'τ\'' => '400',
|
||||
'τʼ' => '400',
|
||||
'τ᾿' => '400',
|
||||
'τζ\'' => '4000',
|
||||
'τζʼ' => '4000',
|
||||
'τζ᾿' => '4000',
|
||||
'τσ\'' => '4000',
|
||||
'τσʼ' => '4000',
|
||||
'τσ᾽' => '4000',
|
||||
'τϲ\'' => '4000',
|
||||
'τϲʼ' => '4000',
|
||||
'τϲ᾿' => '4000',
|
||||
'φ\'' => '400',
|
||||
'φʼ' => '400',
|
||||
'φ᾿' => '400',
|
||||
'χ\'' => '400',
|
||||
'χʼ' => '400',
|
||||
'χ᾿' => '400',
|
||||
'ψ\'' => '400',
|
||||
'ψʼ' => '400',
|
||||
'ψ᾿' => '400',
|
||||
'ββ' => '410',
|
||||
'γγ' => '410',
|
||||
'δδ' => '410',
|
||||
'ζζ' => '410',
|
||||
'θθ' => '410',
|
||||
'κκ' => '410',
|
||||
'λλ' => '410',
|
||||
'μμ' => '410',
|
||||
'νν' => '410',
|
||||
'ππ' => '410',
|
||||
'ρρ' => '410',
|
||||
'σσ' => '410',
|
||||
'ϲϲ' => '410',
|
||||
'ττ' => '410',
|
||||
'φφ' => '410',
|
||||
'χχ' => '410',
|
||||
'ψψ' => '410',
|
||||
'βζ' => '410',
|
||||
'βθ' => '410',
|
||||
'βκ' => '410',
|
||||
'βμ' => '410',
|
||||
'βν' => '410',
|
||||
'βξ' => '410',
|
||||
'βπ' => '410',
|
||||
'βσ' => '410',
|
||||
'βϲ' => '410',
|
||||
'βτ' => '410',
|
||||
'βφ' => '410',
|
||||
'βχ' => '410',
|
||||
'βψ' => '410',
|
||||
'γβ' => '410',
|
||||
'γζ' => '410',
|
||||
'γθ' => '410',
|
||||
'γμ' => '410',
|
||||
'ργμ' => '4520',
|
||||
'γξ' => '410',
|
||||
'γπ' => '410',
|
||||
'γσ' => '410',
|
||||
'γϲ' => '410',
|
||||
'γτ' => '410',
|
||||
'γφ' => '410',
|
||||
'γχ' => '410',
|
||||
'γψ' => '410',
|
||||
'δβ' => '410',
|
||||
'δγ' => '410',
|
||||
'δζ' => '410',
|
||||
'δθ' => '410',
|
||||
'δκ' => '410',
|
||||
'δλ' => '410',
|
||||
'δξ' => '410',
|
||||
'δπ' => '410',
|
||||
'δσ' => '410',
|
||||
'δϲ' => '410',
|
||||
'δτ' => '410',
|
||||
'δφ' => '410',
|
||||
'δχ' => '410',
|
||||
'δψ' => '410',
|
||||
'ζβ' => '410',
|
||||
'ζγ' => '410',
|
||||
'ζδ' => '410',
|
||||
'ζθ' => '410',
|
||||
'ζκ' => '410',
|
||||
'ζλ' => '410',
|
||||
'ζμ' => '410',
|
||||
'τζμ' => '0020',
|
||||
'ζν' => '410',
|
||||
'ζξ' => '410',
|
||||
'ζπ' => '410',
|
||||
'ζρ' => '410',
|
||||
'ζσ' => '410',
|
||||
'ζϲ' => '410',
|
||||
'ζτ' => '410',
|
||||
'ζφ' => '410',
|
||||
'ζχ' => '410',
|
||||
'ζψ' => '410',
|
||||
'θβ' => '410',
|
||||
'θγ' => '410',
|
||||
'θδ' => '410',
|
||||
'θζ' => '410',
|
||||
'θκ' => '410',
|
||||
'θμ' => '410',
|
||||
'ρθμ' => '4520',
|
||||
'σθμ' => '0020',
|
||||
'ϲθμ' => '0020',
|
||||
'θξ' => '410',
|
||||
'θπ' => '410',
|
||||
'θσ' => '410',
|
||||
'θϲ' => '410',
|
||||
'θτ' => '410',
|
||||
'θφ' => '410',
|
||||
'θχ' => '410',
|
||||
'θψ' => '410',
|
||||
'κβ' => '410',
|
||||
'κγ' => '410',
|
||||
'κδ' => '410',
|
||||
'κζ' => '410',
|
||||
'κθ' => '410',
|
||||
'κμ' => '410',
|
||||
'λκμ' => '4520',
|
||||
'ρκμ' => '4520',
|
||||
'κξ' => '410',
|
||||
'κπ' => '410',
|
||||
'κσ' => '410',
|
||||
'κϲ' => '410',
|
||||
'κφ' => '410',
|
||||
'νκφ' => '4520',
|
||||
'κχ' => '410',
|
||||
'κψ' => '410',
|
||||
'λβ' => '410',
|
||||
'λγ' => '410',
|
||||
'λδ' => '410',
|
||||
'λζ' => '410',
|
||||
'λθ' => '410',
|
||||
'λκ' => '410',
|
||||
'λμ' => '410',
|
||||
'λν' => '410',
|
||||
'λξ' => '410',
|
||||
'λπ' => '410',
|
||||
'λρ' => '410',
|
||||
'λσ' => '410',
|
||||
'λϲ' => '410',
|
||||
'λτ' => '410',
|
||||
'λφ' => '410',
|
||||
'λχ' => '410',
|
||||
'λψ' => '410',
|
||||
'μβ' => '410',
|
||||
'μγ' => '410',
|
||||
'μδ' => '410',
|
||||
'μζ' => '410',
|
||||
'μθ' => '410',
|
||||
'μκ' => '410',
|
||||
'μλ' => '410',
|
||||
'μξ' => '410',
|
||||
'μρ' => '410',
|
||||
'μσ' => '410',
|
||||
'μϲ' => '410',
|
||||
'μτ' => '410',
|
||||
'μφ' => '410',
|
||||
'μχ' => '410',
|
||||
'μψ' => '410',
|
||||
'νβ' => '410',
|
||||
'νγ' => '410',
|
||||
'νδ' => '410',
|
||||
'νζ' => '410',
|
||||
'νθ' => '410',
|
||||
'νκ' => '410',
|
||||
'νλ' => '410',
|
||||
'νμ' => '410',
|
||||
'νξ' => '410',
|
||||
'νπ' => '410',
|
||||
'νρ' => '410',
|
||||
'νσ' => '410',
|
||||
'νϲ' => '410',
|
||||
'νφ' => '410',
|
||||
'νχ' => '410',
|
||||
'νψ' => '410',
|
||||
'ξβ' => '410',
|
||||
'ξγ' => '410',
|
||||
'ξδ' => '410',
|
||||
'ξζ' => '410',
|
||||
'ξθ' => '410',
|
||||
'ξκ' => '410',
|
||||
'ξλ' => '410',
|
||||
'ξμ' => '410',
|
||||
'ξν' => '410',
|
||||
'ξπ' => '410',
|
||||
'ξρ' => '410',
|
||||
'ξσ' => '410',
|
||||
'ξϲ' => '410',
|
||||
'ξτ' => '410',
|
||||
'γξτ' => '4520',
|
||||
'ρξτ' => '4520',
|
||||
'ξφ' => '410',
|
||||
'ξχ' => '410',
|
||||
'ξψ' => '410',
|
||||
'πβ' => '410',
|
||||
'πγ' => '410',
|
||||
'πδ' => '410',
|
||||
'πζ' => '410',
|
||||
'πθ' => '410',
|
||||
'πκ' => '410',
|
||||
'πμ' => '410',
|
||||
'πξ' => '410',
|
||||
'πσ' => '410',
|
||||
'πϲ' => '410',
|
||||
'πφ' => '410',
|
||||
'πχ' => '410',
|
||||
'πψ' => '410',
|
||||
'ρβ' => '410',
|
||||
'ργ' => '410',
|
||||
'ρδ' => '410',
|
||||
'ρζ' => '410',
|
||||
'ρθ' => '410',
|
||||
'ρκ' => '410',
|
||||
'ρλ' => '410',
|
||||
'ρμ' => '410',
|
||||
'ρν' => '410',
|
||||
'ρξ' => '410',
|
||||
'ρπ' => '410',
|
||||
'ρσ' => '410',
|
||||
'ρϲ' => '410',
|
||||
'ρτ' => '410',
|
||||
'ρφ' => '410',
|
||||
'ρχ' => '410',
|
||||
'ρψ' => '410',
|
||||
'σδ' => '410',
|
||||
'ϲδ' => '410',
|
||||
'σζ' => '410',
|
||||
'ϲζ' => '410',
|
||||
'σν' => '410',
|
||||
'ϲν' => '410',
|
||||
'σξ' => '410',
|
||||
'ϲξ' => '410',
|
||||
'σρ' => '410',
|
||||
'ϲρ' => '410',
|
||||
'σψ' => '410',
|
||||
'ϲψ' => '410',
|
||||
'τβ' => '410',
|
||||
'τγ' => '410',
|
||||
'τδ' => '410',
|
||||
'τθ' => '410',
|
||||
'τκ' => '410',
|
||||
'τν' => '410',
|
||||
'τξ' => '410',
|
||||
'τπ' => '410',
|
||||
'τφ' => '410',
|
||||
'στφ' => '0020',
|
||||
'ϲτφ' => '0020',
|
||||
'τχ' => '410',
|
||||
'τψ' => '410',
|
||||
'φβ' => '410',
|
||||
'φγ' => '410',
|
||||
'φδ' => '410',
|
||||
'φζ' => '410',
|
||||
'φκ' => '410',
|
||||
'φμ' => '410',
|
||||
'φν' => '410',
|
||||
'ρφν' => '4520',
|
||||
'φξ' => '410',
|
||||
'φπ' => '410',
|
||||
'φσ' => '410',
|
||||
'φϲ' => '410',
|
||||
'φχ' => '410',
|
||||
'φψ' => '410',
|
||||
'χβ' => '410',
|
||||
'χγ' => '410',
|
||||
'χδ' => '410',
|
||||
'χζ' => '410',
|
||||
'χκ' => '410',
|
||||
'χμ' => '410',
|
||||
'ρχμ' => '4520',
|
||||
'χξ' => '410',
|
||||
'χπ' => '410',
|
||||
'χσ' => '410',
|
||||
'χϲ' => '410',
|
||||
'χφ' => '410',
|
||||
'χψ' => '410',
|
||||
'ψβ' => '410',
|
||||
'ψγ' => '410',
|
||||
'ψδ' => '410',
|
||||
'ψζ' => '410',
|
||||
'ψθ' => '410',
|
||||
'ψκ' => '410',
|
||||
'ψλ' => '410',
|
||||
'ψμ' => '410',
|
||||
'ψν' => '410',
|
||||
'ψξ' => '410',
|
||||
'ψπ' => '410',
|
||||
'ψρ' => '410',
|
||||
'ψσ' => '410',
|
||||
'ψϲ' => '410',
|
||||
'ψτ' => '410',
|
||||
'μψτ' => '4520',
|
||||
'ψφ' => '410',
|
||||
'ψχ' => '410',
|
||||
'γκφ' => '4520',
|
||||
'γκτ' => '4100',
|
||||
'μπτ' => '4100',
|
||||
'ντζ' => '4100',
|
||||
'ντσ' => '4100',
|
||||
'ντϲ' => '4100',
|
||||
'γκμπ' => '40100',
|
||||
'γκντ' => '40100',
|
||||
'γκτζ' => '40100',
|
||||
'γκτσ' => '40100',
|
||||
'γκτϲ' => '40100',
|
||||
'μπντ' => '40100',
|
||||
'μπτζ' => '40100',
|
||||
'μπτσ' => '40100',
|
||||
'μπτϲ' => '40100',
|
||||
'ντμπ' => '40100',
|
||||
'τσγκ' => '40100',
|
||||
'τϲγκ' => '40100',
|
||||
'τσμπ' => '40100',
|
||||
'τϲμπ' => '40100',
|
||||
'τσντ' => '40100',
|
||||
'τϲντ' => '40100',
|
||||
),
|
||||
);
|
||||
|
||||
1281
site/OFF_plugins/typography/php-typography/lang/el-Poly.php
Normal file
1281
site/OFF_plugins/typography/php-typography/lang/el-Poly.php
Normal file
File diff suppressed because it is too large
Load diff
8628
site/OFF_plugins/typography/php-typography/lang/en-GB.php
Normal file
8628
site/OFF_plugins/typography/php-typography/lang/en-GB.php
Normal file
File diff suppressed because it is too large
Load diff
5028
site/OFF_plugins/typography/php-typography/lang/en-US.php
Normal file
5028
site/OFF_plugins/typography/php-typography/lang/en-US.php
Normal file
File diff suppressed because it is too large
Load diff
3669
site/OFF_plugins/typography/php-typography/lang/es.php
Normal file
3669
site/OFF_plugins/typography/php-typography/lang/es.php
Normal file
File diff suppressed because it is too large
Load diff
3806
site/OFF_plugins/typography/php-typography/lang/et.php
Normal file
3806
site/OFF_plugins/typography/php-typography/lang/et.php
Normal file
File diff suppressed because it is too large
Load diff
270
site/OFF_plugins/typography/php-typography/lang/eu.php
Normal file
270
site/OFF_plugins/typography/php-typography/lang/eu.php
Normal file
|
|
@ -0,0 +1,270 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Project: wp-Typography
|
||||
Project URI: https://code.mundschenk.at/wp-typography/
|
||||
|
||||
File modified to place pattern and exceptions in arrays that can be understood in php files.
|
||||
This file is released under the same copyright as the below referenced original file
|
||||
Original unmodified file is available at: http://ctan.mirrorcatalogs.com/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex
|
||||
Original file name: hyph-eu.tex
|
||||
|
||||
//============================================================================================================
|
||||
ORIGINAL FILE INFO
|
||||
|
||||
% Hyphenation patterns for Basque.
|
||||
%
|
||||
% This file has first been written by Juan M. Aguirregabiria
|
||||
% (juanmari.aguirregabiria@ehu.es) on February 1997 based on the
|
||||
% shyphen.sh script that generates the Spanish patterns as compiled
|
||||
% by Julio Sanchez (jsanchez@gmv.es) on September 1991.
|
||||
%
|
||||
% In June 2008 the generating script has been rewritten into ruby and
|
||||
% adapted for native UTF-8 TeX engines. Patterns became part of hyph-utf8
|
||||
% package and were renamed from bahyph.tex into hyph-eu.tex.
|
||||
% Functionality should not change apart from adding ñ by default.
|
||||
%
|
||||
% The original Copyright followed and applied also to precessor of this file
|
||||
% whose last version will be always available by anonymous ftp
|
||||
% from tp.lc.ehu.es or by poynting your Web browser to
|
||||
% http://tp.lc.ehu.es/jma/basque.html
|
||||
%
|
||||
% For more information about the new UTF-8 hyphenation patterns and
|
||||
% links to this file see
|
||||
% http://www.tug.org/tex-hyphen/
|
||||
%
|
||||
% COPYRIGHT NOTICE
|
||||
%
|
||||
% These patterns and the generating script are Copyright (c) JMA 1997, 2008
|
||||
% These patterns are made public in the hope that they will benefit others.
|
||||
% You can use this software for any purpose.
|
||||
% However, this is given for free and WITHOUT ANY WARRANTY.
|
||||
%
|
||||
% You are kindly requested to send any changes to the author.
|
||||
% If you change the generating script, you must include code
|
||||
% in it such that any output is clearly labeled as generated
|
||||
% by a modified script.
|
||||
%
|
||||
% END OF COPYRIGHT NOTICE
|
||||
%
|
||||
% Open vowels: a e o
|
||||
% Closed vowels: i u
|
||||
% Consonants: b c d f g j k l m n ñ p q r s t v w x y z
|
||||
%
|
||||
% Some of the patterns below represent combinations that never
|
||||
% happen in Basque. Would they happen, they would be hyphenated
|
||||
% according to the rules.
|
||||
%
|
||||
|
||||
|
||||
//============================================================================================================
|
||||
|
||||
*/
|
||||
|
||||
$patgenLanguage = 'Basque';
|
||||
|
||||
$patgenExceptions = array();
|
||||
|
||||
$patgenMaxSeg = 4;
|
||||
|
||||
$patgen = array(
|
||||
'begin' => array( ),
|
||||
|
||||
'end' => array( ),
|
||||
|
||||
'all' => array(
|
||||
'ba' => '100',
|
||||
'be' => '100',
|
||||
'bo' => '100',
|
||||
'bi' => '100',
|
||||
'bu' => '100',
|
||||
'ca' => '100',
|
||||
'ce' => '100',
|
||||
'co' => '100',
|
||||
'ci' => '100',
|
||||
'cu' => '100',
|
||||
'da' => '100',
|
||||
'de' => '100',
|
||||
'do' => '100',
|
||||
'di' => '100',
|
||||
'du' => '100',
|
||||
'fa' => '100',
|
||||
'fe' => '100',
|
||||
'fo' => '100',
|
||||
'fi' => '100',
|
||||
'fu' => '100',
|
||||
'ga' => '100',
|
||||
'ge' => '100',
|
||||
'go' => '100',
|
||||
'gi' => '100',
|
||||
'gu' => '100',
|
||||
'ja' => '100',
|
||||
'je' => '100',
|
||||
'jo' => '100',
|
||||
'ji' => '100',
|
||||
'ju' => '100',
|
||||
'ka' => '100',
|
||||
'ke' => '100',
|
||||
'ko' => '100',
|
||||
'ki' => '100',
|
||||
'ku' => '100',
|
||||
'la' => '100',
|
||||
'le' => '100',
|
||||
'lo' => '100',
|
||||
'li' => '100',
|
||||
'lu' => '100',
|
||||
'ma' => '100',
|
||||
'me' => '100',
|
||||
'mo' => '100',
|
||||
'mi' => '100',
|
||||
'mu' => '100',
|
||||
'na' => '100',
|
||||
'ne' => '100',
|
||||
'no' => '100',
|
||||
'ni' => '100',
|
||||
'nu' => '100',
|
||||
'ña' => '100',
|
||||
'ñe' => '100',
|
||||
'ño' => '100',
|
||||
'ñi' => '100',
|
||||
'ñu' => '100',
|
||||
'pa' => '100',
|
||||
'pe' => '100',
|
||||
'po' => '100',
|
||||
'pi' => '100',
|
||||
'pu' => '100',
|
||||
'qa' => '100',
|
||||
'qe' => '100',
|
||||
'qo' => '100',
|
||||
'qi' => '100',
|
||||
'qu' => '100',
|
||||
'ra' => '100',
|
||||
're' => '100',
|
||||
'ro' => '100',
|
||||
'ri' => '100',
|
||||
'ru' => '100',
|
||||
'sa' => '100',
|
||||
'se' => '100',
|
||||
'so' => '100',
|
||||
'si' => '100',
|
||||
'su' => '100',
|
||||
'ta' => '100',
|
||||
'te' => '100',
|
||||
'to' => '100',
|
||||
'ti' => '100',
|
||||
'tu' => '100',
|
||||
'va' => '100',
|
||||
've' => '100',
|
||||
'vo' => '100',
|
||||
'vi' => '100',
|
||||
'vu' => '100',
|
||||
'wa' => '100',
|
||||
'we' => '100',
|
||||
'wo' => '100',
|
||||
'wi' => '100',
|
||||
'wu' => '100',
|
||||
'xa' => '100',
|
||||
'xe' => '100',
|
||||
'xo' => '100',
|
||||
'xi' => '100',
|
||||
'xu' => '100',
|
||||
'ya' => '100',
|
||||
'ye' => '100',
|
||||
'yo' => '100',
|
||||
'yi' => '100',
|
||||
'yu' => '100',
|
||||
'za' => '100',
|
||||
'ze' => '100',
|
||||
'zo' => '100',
|
||||
'zi' => '100',
|
||||
'zu' => '100',
|
||||
'lla' => '1200',
|
||||
'lle' => '1200',
|
||||
'llo' => '1200',
|
||||
'lli' => '1200',
|
||||
'llu' => '1200',
|
||||
'rra' => '1200',
|
||||
'rre' => '1200',
|
||||
'rro' => '1200',
|
||||
'rri' => '1200',
|
||||
'rru' => '1200',
|
||||
'tsa' => '1200',
|
||||
'tse' => '1200',
|
||||
'tso' => '1200',
|
||||
'tsi' => '1200',
|
||||
'tsu' => '1200',
|
||||
'txa' => '1200',
|
||||
'txe' => '1200',
|
||||
'txo' => '1200',
|
||||
'txi' => '1200',
|
||||
'txu' => '1200',
|
||||
'tza' => '1200',
|
||||
'tze' => '1200',
|
||||
'tzo' => '1200',
|
||||
'tzi' => '1200',
|
||||
'tzu' => '1200',
|
||||
'bla' => '1200',
|
||||
'ble' => '1200',
|
||||
'blo' => '1200',
|
||||
'bli' => '1200',
|
||||
'blu' => '1200',
|
||||
'bra' => '1200',
|
||||
'bre' => '1200',
|
||||
'bro' => '1200',
|
||||
'bri' => '1200',
|
||||
'bru' => '1200',
|
||||
'dra' => '1200',
|
||||
'dre' => '1200',
|
||||
'dro' => '1200',
|
||||
'dri' => '1200',
|
||||
'dru' => '1200',
|
||||
'fla' => '1200',
|
||||
'fle' => '1200',
|
||||
'flo' => '1200',
|
||||
'fli' => '1200',
|
||||
'flu' => '1200',
|
||||
'fra' => '1200',
|
||||
'fre' => '1200',
|
||||
'fro' => '1200',
|
||||
'fri' => '1200',
|
||||
'fru' => '1200',
|
||||
'gla' => '1200',
|
||||
'gle' => '1200',
|
||||
'glo' => '1200',
|
||||
'gli' => '1200',
|
||||
'glu' => '1200',
|
||||
'gra' => '1200',
|
||||
'gre' => '1200',
|
||||
'gro' => '1200',
|
||||
'gri' => '1200',
|
||||
'gru' => '1200',
|
||||
'kla' => '1200',
|
||||
'kle' => '1200',
|
||||
'klo' => '1200',
|
||||
'kli' => '1200',
|
||||
'klu' => '1200',
|
||||
'kra' => '1200',
|
||||
'kre' => '1200',
|
||||
'kro' => '1200',
|
||||
'kri' => '1200',
|
||||
'kru' => '1200',
|
||||
'pla' => '1200',
|
||||
'ple' => '1200',
|
||||
'plo' => '1200',
|
||||
'pli' => '1200',
|
||||
'plu' => '1200',
|
||||
'pra' => '1200',
|
||||
'pre' => '1200',
|
||||
'pro' => '1200',
|
||||
'pri' => '1200',
|
||||
'pru' => '1200',
|
||||
'tra' => '1200',
|
||||
'tre' => '1200',
|
||||
'tro' => '1200',
|
||||
'tri' => '1200',
|
||||
'tru' => '1200',
|
||||
'subr' => '00220',
|
||||
'subl' => '00220',
|
||||
),
|
||||
);
|
||||
|
||||
399
site/OFF_plugins/typography/php-typography/lang/fi.php
Normal file
399
site/OFF_plugins/typography/php-typography/lang/fi.php
Normal file
|
|
@ -0,0 +1,399 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Project: wp-Typography
|
||||
Project URI: https://code.mundschenk.at/wp-typography/
|
||||
|
||||
File modified to place pattern and exceptions in arrays that can be understood in php files.
|
||||
This file is released under the same copyright as the below referenced original file
|
||||
Original unmodified file is available at: http://ctan.mirrorcatalogs.com/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex
|
||||
Original file name: hyph-fi.tex
|
||||
|
||||
//============================================================================================================
|
||||
ORIGINAL FILE INFO
|
||||
|
||||
% This file is part of hyph-utf8 package and resulted from
|
||||
% semi-manual conversions of hyphenation patterns into UTF-8 in June 2008.
|
||||
%
|
||||
% Source: fihyph.tex (yyyy-mm-dd)
|
||||
% Author: Kauko Saarinen
|
||||
%
|
||||
% The above mentioned file should become obsolete,
|
||||
% and the author of the original file should preferably modify this file instead.
|
||||
%
|
||||
% Modifications were needed in order to support native UTF-8 engines,
|
||||
% but functionality (hopefully) didn't change in any way, at least not intentionally.
|
||||
% This file is no longer stand-alone; at least for 8-bit engines
|
||||
% you probably want to use loadhyph-foo.tex (which will load this file) instead.
|
||||
%
|
||||
% Modifications were done by Jonathan Kew, Mojca Miklavec & Arthur Reutenauer
|
||||
% with help & support from:
|
||||
% - Karl Berry, who gave us free hands and all resources
|
||||
% - Taco Hoekwater, with useful macros
|
||||
% - Hans Hagen, who did the unicodification of patterns already long before
|
||||
% and helped with testing, suggestions and bug reports
|
||||
% - Norbert Preining, who tested & integrated patterns into TeX Live
|
||||
%
|
||||
% However, the "copyright/copyleft" owner of patterns remains the original author.
|
||||
%
|
||||
% The copyright statement of this file is thus:
|
||||
%
|
||||
% Do with this file whatever needs to be done in future for the sake of
|
||||
% "a better world" as long as you respect the copyright of original file.
|
||||
% If you're the original author of patterns or taking over a new revolution,
|
||||
% plese remove all of the TUG comments & credits that we added here -
|
||||
% you are the Queen / the King, we are only the servants.
|
||||
%
|
||||
% If you want to change this file, rather than uploading directly to CTAN,
|
||||
% we would be grateful if you could send it to us (http://tug.org/tex-hyphen)
|
||||
% or ask for credentials for SVN repository and commit it yourself;
|
||||
% we will then upload the whole "package" to CTAN.
|
||||
%
|
||||
% Before a new "pattern-revolution" starts,
|
||||
% please try to follow some guidelines if possible:
|
||||
%
|
||||
% - \lccode is *forbidden*, and I really mean it
|
||||
% - all the patterns should be in UTF-8
|
||||
% - the only "allowed" TeX commands in this file are: \patterns, \hyphenation,
|
||||
% and if you really cannot do without, also \input and \message
|
||||
% - in particular, please no \catcode or \lccode changes,
|
||||
% they belong to loadhyph-foo.tex,
|
||||
% and no \lefthyphenmin and \righthyphenmin,
|
||||
% they have no influence here and belong elsewhere
|
||||
% - \begingroup and/or \endinput is not needed
|
||||
% - feel free to do whatever you want inside comments
|
||||
%
|
||||
% We know that TeX is extremely powerful, but give a stupid parser
|
||||
% at least a chance to read your patterns.
|
||||
%
|
||||
% For more unformation see
|
||||
%
|
||||
% http://tug.org/tex-hyphen
|
||||
%
|
||||
%------------------------------------------------------------------------------
|
||||
%
|
||||
% -----> Finnish hyphenation patterns for MLPCTeX <------
|
||||
% First release January -86 by Kauko Saarinen,
|
||||
% Computing Centre, University of Jyvaskyla, Finland
|
||||
%
|
||||
% Completely rewritten January -88. The new patterns make
|
||||
% much less mistakes with foreign and compound words.
|
||||
% The article "Automatic Hyphenation of Finnish"
|
||||
% by Professor Fred Karlsson is also referred
|
||||
% ---------------------------------------------------------
|
||||
%
|
||||
% 8th March -89 (vers. 2.2), some vowel triples by Fred Karlsson added.
|
||||
% 9th January - 95: added \uccode and \lccode by Thomas Esser
|
||||
%
|
||||
% ********* Patterns may be freely distributed **********
|
||||
%
|
||||
%
|
||||
|
||||
|
||||
//============================================================================================================
|
||||
|
||||
*/
|
||||
|
||||
$patgenLanguage = 'Finnish';
|
||||
|
||||
$patgenExceptions = array();
|
||||
|
||||
$patgenMaxSeg = 7;
|
||||
|
||||
$patgen = array(
|
||||
'begin' => array(
|
||||
'ä' => '02',
|
||||
'ydin' => '00021',
|
||||
'suura' => '000212',
|
||||
),
|
||||
|
||||
'end' => array(
|
||||
'sidea' => '212000',
|
||||
),
|
||||
|
||||
'all' => array(
|
||||
'ba' => '100',
|
||||
'be' => '100',
|
||||
'bi' => '100',
|
||||
'bo' => '100',
|
||||
'bu' => '100',
|
||||
'by' => '100',
|
||||
'da' => '100',
|
||||
'de' => '100',
|
||||
'di' => '100',
|
||||
'do' => '100',
|
||||
'du' => '100',
|
||||
'dy' => '100',
|
||||
'dä' => '100',
|
||||
'dö' => '100',
|
||||
'fa' => '100',
|
||||
'fe' => '100',
|
||||
'fi' => '100',
|
||||
'fo' => '100',
|
||||
'fu' => '100',
|
||||
'fy' => '100',
|
||||
'ga' => '100',
|
||||
'ge' => '100',
|
||||
'gi' => '100',
|
||||
'go' => '100',
|
||||
'gu' => '100',
|
||||
'gy' => '100',
|
||||
'gä' => '100',
|
||||
'gö' => '100',
|
||||
'ha' => '100',
|
||||
'he' => '100',
|
||||
'hi' => '100',
|
||||
'ho' => '100',
|
||||
'hu' => '100',
|
||||
'hy' => '100',
|
||||
'hä' => '100',
|
||||
'hö' => '100',
|
||||
'ja' => '100',
|
||||
'je' => '100',
|
||||
'ji' => '100',
|
||||
'jo' => '100',
|
||||
'ju' => '100',
|
||||
'jy' => '100',
|
||||
'jä' => '100',
|
||||
'jö' => '100',
|
||||
'ka' => '100',
|
||||
'ke' => '100',
|
||||
'ki' => '100',
|
||||
'ko' => '100',
|
||||
'ku' => '100',
|
||||
'ky' => '100',
|
||||
'kä' => '100',
|
||||
'kö' => '100',
|
||||
'la' => '100',
|
||||
'le' => '100',
|
||||
'li' => '100',
|
||||
'lo' => '100',
|
||||
'lu' => '100',
|
||||
'ly' => '100',
|
||||
'lä' => '100',
|
||||
'lö' => '100',
|
||||
'ma' => '100',
|
||||
'me' => '100',
|
||||
'mi' => '100',
|
||||
'mo' => '100',
|
||||
'mu' => '100',
|
||||
'my' => '100',
|
||||
'mä' => '100',
|
||||
'mö' => '100',
|
||||
'na' => '100',
|
||||
'ne' => '100',
|
||||
'ni' => '100',
|
||||
'no' => '100',
|
||||
'nu' => '100',
|
||||
'ny' => '100',
|
||||
'nä' => '100',
|
||||
'nö' => '100',
|
||||
'pa' => '100',
|
||||
'pe' => '100',
|
||||
'pi' => '100',
|
||||
'po' => '100',
|
||||
'pu' => '100',
|
||||
'py' => '100',
|
||||
'pä' => '100',
|
||||
'pö' => '100',
|
||||
'ra' => '100',
|
||||
're' => '100',
|
||||
'ri' => '100',
|
||||
'ro' => '100',
|
||||
'ru' => '100',
|
||||
'ry' => '100',
|
||||
'rä' => '100',
|
||||
'rö' => '100',
|
||||
'sa' => '100',
|
||||
'se' => '100',
|
||||
'si' => '100',
|
||||
'so' => '100',
|
||||
'su' => '100',
|
||||
'sy' => '100',
|
||||
'sä' => '100',
|
||||
'sö' => '100',
|
||||
'ta' => '100',
|
||||
'te' => '100',
|
||||
'ti' => '100',
|
||||
'to' => '100',
|
||||
'tu' => '100',
|
||||
'ty' => '100',
|
||||
'tä' => '100',
|
||||
'tö' => '100',
|
||||
'va' => '100',
|
||||
've' => '100',
|
||||
'vi' => '100',
|
||||
'vo' => '100',
|
||||
'vu' => '100',
|
||||
'vy' => '100',
|
||||
'vä' => '100',
|
||||
'vö' => '100',
|
||||
'str' => '1020',
|
||||
'äy' => '020',
|
||||
'ya' => '012',
|
||||
'yo' => '012',
|
||||
'oy' => '010',
|
||||
'öy' => '020',
|
||||
'uy' => '012',
|
||||
'yu' => '012',
|
||||
'öa' => '032',
|
||||
'öo' => '032',
|
||||
'äa' => '032',
|
||||
'äo' => '032',
|
||||
'äu' => '012',
|
||||
'öu' => '012',
|
||||
'aä' => '010',
|
||||
'aö' => '010',
|
||||
'oä' => '010',
|
||||
'oö' => '010',
|
||||
'uä' => '012',
|
||||
'uö' => '012',
|
||||
'ää' => '020',
|
||||
'öö' => '020',
|
||||
'äö' => '020',
|
||||
'öä' => '020',
|
||||
'aai' => '0012',
|
||||
'aae' => '0012',
|
||||
'aao' => '0012',
|
||||
'aau' => '0012',
|
||||
'eea' => '0012',
|
||||
'eei' => '0012',
|
||||
'eeu' => '0012',
|
||||
'eey' => '0012',
|
||||
'iia' => '0012',
|
||||
'iie' => '0012',
|
||||
'iio' => '0012',
|
||||
'uua' => '0012',
|
||||
'uue' => '0012',
|
||||
'uuo' => '0012',
|
||||
'uui' => '0012',
|
||||
'eaa' => '0100',
|
||||
'iaa' => '0100',
|
||||
'oaa' => '0100',
|
||||
'uaa' => '0100',
|
||||
'uee' => '0100',
|
||||
'auu' => '0100',
|
||||
'iuu' => '0100',
|
||||
'euu' => '0100',
|
||||
'ouu' => '0100',
|
||||
'ääi' => '0010',
|
||||
'ääe' => '0010',
|
||||
'ääy' => '0030',
|
||||
'iää' => '0100',
|
||||
'eää' => '0100',
|
||||
'yää' => '0100',
|
||||
'iöö' => '0100',
|
||||
'aei' => '0100',
|
||||
'aoi' => '0100',
|
||||
'eai' => '0100',
|
||||
'iau' => '0100',
|
||||
'yei' => '0100',
|
||||
'aia' => '0010',
|
||||
'aie' => '0010',
|
||||
'aio' => '0010',
|
||||
'aiu' => '0010',
|
||||
'aua' => '0010',
|
||||
'aue' => '0010',
|
||||
'eua' => '0010',
|
||||
'iea' => '0010',
|
||||
'ieo' => '0010',
|
||||
'iey' => '0010',
|
||||
'ioa' => '0012',
|
||||
'ioe' => '0012',
|
||||
'iua' => '0010',
|
||||
'iue' => '0010',
|
||||
'iuo' => '0010',
|
||||
'oia' => '0010',
|
||||
'oie' => '0010',
|
||||
'oio' => '0010',
|
||||
'oiu' => '0010',
|
||||
'oui' => '0100',
|
||||
'oue' => '0010',
|
||||
'ouo' => '0010',
|
||||
'uea' => '0010',
|
||||
'uie' => '0010',
|
||||
'uoa' => '0010',
|
||||
'uou' => '0010',
|
||||
'eö' => '012',
|
||||
'öe' => '012',
|
||||
'us' => '020',
|
||||
'yliop' => '000120',
|
||||
'aliav' => '000120',
|
||||
'spli' => '10200',
|
||||
'alous' => '000001',
|
||||
'keus' => '00001',
|
||||
'rtaus' => '000001',
|
||||
'sohje' => '210000',
|
||||
'sasia' => '212000',
|
||||
'asian' => '120000',
|
||||
'asiat' => '120000',
|
||||
'asioi' => '120000',
|
||||
'ras' => '0200',
|
||||
'las' => '0200',
|
||||
'sopisk' => '2120000',
|
||||
'nopet' => '212000',
|
||||
'saloi' => '212000',
|
||||
'nopist' => '2120000',
|
||||
'sopist' => '2120000',
|
||||
'sosa' => '21200',
|
||||
'nosa' => '21200',
|
||||
'alkeis' => '0000021',
|
||||
'perus' => '000001',
|
||||
'sidean' => '2120000',
|
||||
'sesity' => '2120000',
|
||||
'nedus' => '212000',
|
||||
'sajatu' => '2100000',
|
||||
'sase' => '21000',
|
||||
'sapu' => '21000',
|
||||
'syrit' => '212000',
|
||||
'syhti' => '212000',
|
||||
'notto' => '210000',
|
||||
'noton' => '210000',
|
||||
'nanto' => '210000',
|
||||
'nanno' => '210000',
|
||||
'najan' => '212000',
|
||||
'naika' => '210000',
|
||||
'nomai' => '212000',
|
||||
'nylit' => '212000',
|
||||
'salen' => '212000',
|
||||
'nalen' => '212000',
|
||||
'asiakas' => '12000021',
|
||||
'ulos' => '00021',
|
||||
'najo' => '21200',
|
||||
'sajo' => '21200',
|
||||
'bl' => '020',
|
||||
'blo' => '1200',
|
||||
'bibli' => '000300',
|
||||
'br' => '020',
|
||||
'bri' => '1200',
|
||||
'bro' => '1200',
|
||||
'bru' => '1200',
|
||||
'dr' => '020',
|
||||
'dra' => '1200',
|
||||
'fl' => '020',
|
||||
'fla' => '1200',
|
||||
'fr' => '020',
|
||||
'fra' => '1200',
|
||||
'fre' => '1200',
|
||||
'gl' => '020',
|
||||
'glo' => '1200',
|
||||
'gr' => '020',
|
||||
'gra' => '1200',
|
||||
'kl' => '020',
|
||||
'kra' => '1200',
|
||||
'kre' => '1200',
|
||||
'kri' => '1200',
|
||||
'kv' => '120',
|
||||
'kva' => '1200',
|
||||
'pl' => '020',
|
||||
'pr' => '020',
|
||||
'pro' => '1200',
|
||||
'cl' => '020',
|
||||
'qv' => '020',
|
||||
'qvi' => '1200',
|
||||
'sch' => '0020',
|
||||
'tsh' => '0020',
|
||||
'chr' => '0020',
|
||||
),
|
||||
);
|
||||
|
||||
1282
site/OFF_plugins/typography/php-typography/lang/fr.php
Normal file
1282
site/OFF_plugins/typography/php-typography/lang/fr.php
Normal file
File diff suppressed because it is too large
Load diff
6218
site/OFF_plugins/typography/php-typography/lang/ga.php
Normal file
6218
site/OFF_plugins/typography/php-typography/lang/ga.php
Normal file
File diff suppressed because it is too large
Load diff
2370
site/OFF_plugins/typography/php-typography/lang/gl.php
Normal file
2370
site/OFF_plugins/typography/php-typography/lang/gl.php
Normal file
File diff suppressed because it is too large
Load diff
4373
site/OFF_plugins/typography/php-typography/lang/grc.php
Normal file
4373
site/OFF_plugins/typography/php-typography/lang/grc.php
Normal file
File diff suppressed because it is too large
Load diff
1530
site/OFF_plugins/typography/php-typography/lang/hr.php
Normal file
1530
site/OFF_plugins/typography/php-typography/lang/hr.php
Normal file
File diff suppressed because it is too large
Load diff
62932
site/OFF_plugins/typography/php-typography/lang/hu.php
Normal file
62932
site/OFF_plugins/typography/php-typography/lang/hu.php
Normal file
File diff suppressed because it is too large
Load diff
1483
site/OFF_plugins/typography/php-typography/lang/hy.php
Normal file
1483
site/OFF_plugins/typography/php-typography/lang/hy.php
Normal file
File diff suppressed because it is too large
Load diff
776
site/OFF_plugins/typography/php-typography/lang/ia.php
Normal file
776
site/OFF_plugins/typography/php-typography/lang/ia.php
Normal file
|
|
@ -0,0 +1,776 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Project: wp-Typography
|
||||
Project URI: https://code.mundschenk.at/wp-typography/
|
||||
|
||||
File modified to place pattern and exceptions in arrays that can be understood in php files.
|
||||
This file is released under the same copyright as the below referenced original file
|
||||
Original unmodified file is available at: http://ctan.mirrorcatalogs.com/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex
|
||||
Original file name: hyph-ia.tex
|
||||
|
||||
//============================================================================================================
|
||||
ORIGINAL FILE INFO
|
||||
|
||||
% This file is part of hyph-utf8 package and resulted from
|
||||
% semi-manual conversions of hyphenation patterns into UTF-8 in June 2008.
|
||||
%
|
||||
% Source: iahyphen.tex (2005-06-28)
|
||||
% Author: Peter Kleiweg <p.c.j.kleiweg at rug.nl>
|
||||
%
|
||||
% The above mentioned file should become obsolete,
|
||||
% and the author of the original file should preferably modify this file instead.
|
||||
%
|
||||
% Modifications were needed in order to support native UTF-8 engines,
|
||||
% but functionality (hopefully) didn't change in any way, at least not intentionally.
|
||||
% This file is no longer stand-alone; at least for 8-bit engines
|
||||
% you probably want to use loadhyph-foo.tex (which will load this file) instead.
|
||||
%
|
||||
% Modifications were done by Jonathan Kew, Mojca Miklavec & Arthur Reutenauer
|
||||
% with help & support from:
|
||||
% - Karl Berry, who gave us free hands and all resources
|
||||
% - Taco Hoekwater, with useful macros
|
||||
% - Hans Hagen, who did the unicodification of patterns already long before
|
||||
% and helped with testing, suggestions and bug reports
|
||||
% - Norbert Preining, who tested & integrated patterns into TeX Live
|
||||
%
|
||||
% However, the "copyright/copyleft" owner of patterns remains the original author.
|
||||
%
|
||||
% The copyright statement of this file is thus:
|
||||
%
|
||||
% Do with this file whatever needs to be done in future for the sake of
|
||||
% "a better world" as long as you respect the copyright of original file.
|
||||
% If you're the original author of patterns or taking over a new revolution,
|
||||
% plese remove all of the TUG comments & credits that we added here -
|
||||
% you are the Queen / the King, we are only the servants.
|
||||
%
|
||||
% If you want to change this file, rather than uploading directly to CTAN,
|
||||
% we would be grateful if you could send it to us (http://tug.org/tex-hyphen)
|
||||
% or ask for credentials for SVN repository and commit it yourself;
|
||||
% we will then upload the whole "package" to CTAN.
|
||||
%
|
||||
% Before a new "pattern-revolution" starts,
|
||||
% please try to follow some guidelines if possible:
|
||||
%
|
||||
% - \lccode is *forbidden*, and I really mean it
|
||||
% - all the patterns should be in UTF-8
|
||||
% - the only "allowed" TeX commands in this file are: \patterns, \hyphenation,
|
||||
% and if you really cannot do without, also \input and \message
|
||||
% - in particular, please no \catcode or \lccode changes,
|
||||
% they belong to loadhyph-foo.tex,
|
||||
% and no \lefthyphenmin and \righthyphenmin,
|
||||
% they have no influence here and belong elsewhere
|
||||
% - \begingroup and/or \endinput is not needed
|
||||
% - feel free to do whatever you want inside comments
|
||||
%
|
||||
% We know that TeX is extremely powerful, but give a stupid parser
|
||||
% at least a chance to read your patterns.
|
||||
%
|
||||
% For more unformation see
|
||||
%
|
||||
% http://tug.org/tex-hyphen
|
||||
%
|
||||
%------------------------------------------------------------------------------
|
||||
%
|
||||
% File: iahyphen.tex
|
||||
% TeX hyphenation patterns for Interlingua.
|
||||
% Version 0.2b. Released 3 July 2001.
|
||||
% version 0.2c Released 28 June 2005 (added LPPL header)
|
||||
% Created by Peter Kleiweg, p.c.j.kleiweg at rug.nl
|
||||
% About Interlingua: http://www.interlingua.com/
|
||||
%
|
||||
% \iffalse meta-comment
|
||||
%
|
||||
% Copyright 1989-2005 Peter Kleiweg. All rights reserved.
|
||||
%
|
||||
% This file is distributed as part of the Babel system.
|
||||
% -----------------------------------------------------
|
||||
%
|
||||
% It may be distributed and/or modified under the
|
||||
% conditions of the LaTeX Project Public License, either version 1.3
|
||||
% of this license or (at your option) any later version.
|
||||
% The latest version of this license is in
|
||||
% http://www.latex-project.org/lppl.txt
|
||||
% and version 1.3 or later is part of all distributions of LaTeX
|
||||
% version 2003/12/01 or later.
|
||||
%
|
||||
% This work has the LPPL maintenance status "maintained".
|
||||
%
|
||||
% The Current Maintainer of this work is Peter Kleiweg.
|
||||
%
|
||||
% The list of all files belonging to the Babel system is
|
||||
% given in the file `manifest.bbl. See also `legal.bbl' for additional
|
||||
% information.
|
||||
%
|
||||
% \fi
|
||||
|
||||
|
||||
//============================================================================================================
|
||||
|
||||
*/
|
||||
|
||||
$patgenLanguage = 'Interlingua';
|
||||
|
||||
$patgenExceptions = array(
|
||||
'alcun' => 'alc-un',
|
||||
'alcunissime' => 'alc-u-nis-si-me',
|
||||
'alcunmente' => 'alc-un-men-te',
|
||||
'alicun' => 'a-lic-un',
|
||||
'alicunissime' => 'a-lic-u-nis-si-me',
|
||||
'alicunmente' => 'a-lic-un-men-te',
|
||||
'moslem' => 'mos-lem',
|
||||
'qualcun' => 'qualc-un',
|
||||
'qualcunissime' => 'qualc-u-nis-si-me',
|
||||
'qualcunmente' => 'qualc-un-men-te',
|
||||
);
|
||||
|
||||
$patgenMaxSeg = 4;
|
||||
|
||||
$patgen = array(
|
||||
'begin' => array(
|
||||
'ch' => '002',
|
||||
'des' => '0040',
|
||||
'in' => '001',
|
||||
'sei' => '0040',
|
||||
),
|
||||
|
||||
'end' => array( ),
|
||||
|
||||
'all' => array(
|
||||
'aa' => '010',
|
||||
'ab' => '010',
|
||||
'abl' => '0210',
|
||||
'ablo' => '03400',
|
||||
'aca' => '0100',
|
||||
'ace' => '0100',
|
||||
'ach' => '0100',
|
||||
'achr' => '04000',
|
||||
'aco' => '0100',
|
||||
'acr' => '0100',
|
||||
'acu' => '0100',
|
||||
'ad' => '010',
|
||||
'adm' => '1000',
|
||||
'adv' => '1000',
|
||||
'ae' => '001',
|
||||
'ael' => '0100',
|
||||
'aero' => '00003',
|
||||
'ag' => '010',
|
||||
'aged' => '04300',
|
||||
'agg' => '1000',
|
||||
'ah' => '010',
|
||||
'aic' => '0100',
|
||||
'ais' => '0100',
|
||||
'aiv' => '0100',
|
||||
'aj' => '010',
|
||||
'ak' => '010',
|
||||
'ala' => '0100',
|
||||
'ale' => '0100',
|
||||
'alei' => '00300',
|
||||
'alo' => '0100',
|
||||
'alu' => '0100',
|
||||
'am' => '010',
|
||||
'anim' => '30000',
|
||||
'ansp' => '00400',
|
||||
'ao' => '010',
|
||||
'ap' => '010',
|
||||
'aq' => '010',
|
||||
'ara' => '0100',
|
||||
'ari' => '0100',
|
||||
'aro' => '0100',
|
||||
'aru' => '0100',
|
||||
'ary' => '0100',
|
||||
'ash' => '0120',
|
||||
'asth' => '30000',
|
||||
'at' => '010',
|
||||
'atyr' => '00004',
|
||||
'av' => '010',
|
||||
'aw' => '010',
|
||||
'az' => '010',
|
||||
'ba' => '100',
|
||||
'bb' => '210',
|
||||
'bbo' => '0300',
|
||||
'bc' => '010',
|
||||
'bd' => '210',
|
||||
'be' => '100',
|
||||
'bh' => '010',
|
||||
'bi' => '100',
|
||||
'bisa' => '00430',
|
||||
'bj' => '010',
|
||||
'blu' => '0100',
|
||||
'bly' => '0200',
|
||||
'bm' => '010',
|
||||
'bn' => '010',
|
||||
'bo' => '100',
|
||||
'bp' => '010',
|
||||
'br' => '120',
|
||||
'bs' => '212',
|
||||
'bt' => '010',
|
||||
'bu' => '100',
|
||||
'bue' => '0010',
|
||||
'bui' => '0010',
|
||||
'bv' => '010',
|
||||
'cai' => '0010',
|
||||
'cc' => '210',
|
||||
'cd' => '010',
|
||||
'cenn' => '43000',
|
||||
'chr' => '1000',
|
||||
'chs' => '2000',
|
||||
'cht' => '2000',
|
||||
'chu' => '1000',
|
||||
'ci' => '100',
|
||||
'ck' => '210',
|
||||
'cl' => '120',
|
||||
'cm' => '210',
|
||||
'cocl' => '00400',
|
||||
'cop' => '0032',
|
||||
'cq' => '010',
|
||||
'cr' => '020',
|
||||
'cs' => '012',
|
||||
'ct' => '210',
|
||||
'ctro' => '00003',
|
||||
'cua' => '0010',
|
||||
'cue' => '0010',
|
||||
'cui' => '0010',
|
||||
'cy' => '100',
|
||||
'cyne' => '00400',
|
||||
'cyr' => '0002',
|
||||
'cz' => '010',
|
||||
'da' => '100',
|
||||
'dd' => '210',
|
||||
'de' => '100',
|
||||
'deru' => '00400',
|
||||
'dese' => '00030',
|
||||
'deso' => '00430',
|
||||
'desu' => '00400',
|
||||
'dg' => '210',
|
||||
'dhe' => '0100',
|
||||
'dias' => '00034',
|
||||
'dipt' => '00340',
|
||||
'disa' => '00400',
|
||||
'dise' => '00430',
|
||||
'disi' => '00400',
|
||||
'diso' => '00400',
|
||||
'disu' => '00430',
|
||||
'dj' => '210',
|
||||
'dm' => '210',
|
||||
'do' => '100',
|
||||
'dola' => '00430',
|
||||
'dosm' => '43000',
|
||||
'dr' => '020',
|
||||
'dros' => '00034',
|
||||
'dua' => '0010',
|
||||
'due' => '0010',
|
||||
'dui' => '0010',
|
||||
'dv' => '210',
|
||||
'dys' => '0020',
|
||||
'ea' => '010',
|
||||
'eau' => '0200',
|
||||
'eb' => '010',
|
||||
'eca' => '0100',
|
||||
'ece' => '0100',
|
||||
'eche' => '03000',
|
||||
'echi' => '03000',
|
||||
'eco' => '0100',
|
||||
'ecr' => '0100',
|
||||
'ecu' => '0100',
|
||||
'ed' => '010',
|
||||
'ee' => '010',
|
||||
'ef' => '010',
|
||||
'eff' => '1000',
|
||||
'eg' => '010',
|
||||
'eh' => '010',
|
||||
'ei' => '010',
|
||||
'ej' => '010',
|
||||
'ek' => '010',
|
||||
'ela' => '0100',
|
||||
'ele' => '0100',
|
||||
'elo' => '0100',
|
||||
'elod' => '00300',
|
||||
'elom' => '04300',
|
||||
'elu' => '0100',
|
||||
'em' => '010',
|
||||
'emag' => '04300',
|
||||
'enl' => '2000',
|
||||
'enop' => '00034',
|
||||
'eo' => '010',
|
||||
'eog' => '0032',
|
||||
'eop' => '0032',
|
||||
'eq' => '010',
|
||||
'era' => '0100',
|
||||
'eri' => '0100',
|
||||
'ero' => '0100',
|
||||
'erog' => '40000',
|
||||
'erop' => '00034',
|
||||
'eru' => '0100',
|
||||
'erur' => '00300',
|
||||
'ery' => '0100',
|
||||
'esem' => '00400',
|
||||
'est' => '0200',
|
||||
'esue' => '00300',
|
||||
'et' => '010',
|
||||
'eu' => '001',
|
||||
'euce' => '00400',
|
||||
'eun' => '0100',
|
||||
'ev' => '010',
|
||||
'ew' => '010',
|
||||
'fa' => '100',
|
||||
'ff' => '210',
|
||||
'fh' => '210',
|
||||
'fi' => '100',
|
||||
'fl' => '120',
|
||||
'fo' => '100',
|
||||
'fr' => '120',
|
||||
'ft' => '010',
|
||||
'fu' => '100',
|
||||
'ga' => '100',
|
||||
'gd' => '210',
|
||||
'ge' => '100',
|
||||
'gevi' => '43000',
|
||||
'gg' => '210',
|
||||
'gi' => '100',
|
||||
'gima' => '43000',
|
||||
'gl' => '020',
|
||||
'gm' => '210',
|
||||
'gn' => '210',
|
||||
'go' => '100',
|
||||
'gr' => '120',
|
||||
'gs' => '212',
|
||||
'gu' => '101',
|
||||
'gym' => '0002',
|
||||
'gymn' => '00003',
|
||||
'gyna' => '00400',
|
||||
'gyra' => '00430',
|
||||
'gz' => '210',
|
||||
'he' => '020',
|
||||
'hec' => '0002',
|
||||
'hect' => '00003',
|
||||
'heur' => '00300',
|
||||
'hloc' => '03000',
|
||||
'hm' => '210',
|
||||
'hn' => '010',
|
||||
'hog' => '0032',
|
||||
'hop' => '0032',
|
||||
'horh' => '00300',
|
||||
'hr' => '020',
|
||||
'hs' => '010',
|
||||
'ht' => '010',
|
||||
'ia' => '010',
|
||||
'iala' => '00430',
|
||||
'ib' => '012',
|
||||
'ic' => '010',
|
||||
'id' => '010',
|
||||
'ido' => '0003',
|
||||
'idop' => '00004',
|
||||
'ie' => '010',
|
||||
'if' => '010',
|
||||
'ig' => '010',
|
||||
'ih' => '010',
|
||||
'ii' => '010',
|
||||
'ik' => '010',
|
||||
'il' => '010',
|
||||
'im' => '010',
|
||||
'imad' => '04000',
|
||||
'imb' => '1000',
|
||||
'inf' => '1000',
|
||||
'inr' => '1000',
|
||||
'ins' => '0002',
|
||||
'inv' => '1000',
|
||||
'io' => '011',
|
||||
'iog' => '0032',
|
||||
'ios' => '0002',
|
||||
'iox' => '0020',
|
||||
'ip' => '010',
|
||||
'iq' => '010',
|
||||
'ira' => '0100',
|
||||
'iri' => '0100',
|
||||
'iro' => '0100',
|
||||
'irop' => '00034',
|
||||
'irur' => '00300',
|
||||
'isac' => '00300',
|
||||
'isas' => '00300',
|
||||
'isau' => '00300',
|
||||
'iseq' => '00300',
|
||||
'ises' => '00300',
|
||||
'isil' => '00300',
|
||||
'isin' => '00300',
|
||||
'isph' => '03400',
|
||||
'it' => '010',
|
||||
'iu' => '010',
|
||||
'iv' => '010',
|
||||
'iz' => '010',
|
||||
'kale' => '00400',
|
||||
'ke' => '001',
|
||||
'kra' => '0001',
|
||||
'lalg' => '43000',
|
||||
'larc' => '43000',
|
||||
'lb' => '010',
|
||||
'lc' => '210',
|
||||
'ld' => '210',
|
||||
'lech' => '00300',
|
||||
'leid' => '00400',
|
||||
'lf' => '210',
|
||||
'lg' => '010',
|
||||
'lh' => '210',
|
||||
'li' => '100',
|
||||
'lk' => '210',
|
||||
'll' => '210',
|
||||
'llur' => '00300',
|
||||
'lm' => '210',
|
||||
'lmod' => '04300',
|
||||
'ln' => '010',
|
||||
'lod' => '2000',
|
||||
'lodo' => '03000',
|
||||
'lopi' => '40000',
|
||||
'lp' => '210',
|
||||
'lq' => '010',
|
||||
'ls' => '212',
|
||||
'lt' => '210',
|
||||
'ltun' => '04300',
|
||||
'lue' => '0010',
|
||||
'lui' => '0010',
|
||||
'lur' => '2000',
|
||||
'lv' => '210',
|
||||
'ly' => '100',
|
||||
'lych' => '00300',
|
||||
'ma' => '100',
|
||||
'mb' => '210',
|
||||
'mc' => '010',
|
||||
'me' => '100',
|
||||
'mech' => '00300',
|
||||
'mese' => '00430',
|
||||
'mf' => '010',
|
||||
'mi' => '100',
|
||||
'mip' => '0032',
|
||||
'misi' => '00040',
|
||||
'mj' => '010',
|
||||
'ml' => '010',
|
||||
'mm' => '210',
|
||||
'mmen' => '00043',
|
||||
'mn' => '210',
|
||||
'mnam' => '00300',
|
||||
'mnas' => '00300',
|
||||
'mno' => '0001',
|
||||
'mnob' => '00300',
|
||||
'mnop' => '00300',
|
||||
'mo' => '100',
|
||||
'mony' => '43000',
|
||||
'mop' => '0032',
|
||||
'morr' => '00300',
|
||||
'mosp' => '00040',
|
||||
'most' => '00340',
|
||||
'mp' => '210',
|
||||
'mps' => '0300',
|
||||
'ms' => '012',
|
||||
'mu' => '100',
|
||||
'mv' => '210',
|
||||
'my' => '100',
|
||||
'myrr' => '00400',
|
||||
'na' => '100',
|
||||
'nae' => '0100',
|
||||
'nalg' => '03000',
|
||||
'nani' => '03000',
|
||||
'nap' => '0120',
|
||||
'nau' => '0100',
|
||||
'nb' => '010',
|
||||
'nc' => '010',
|
||||
'nd' => '210',
|
||||
'ne' => '100',
|
||||
'neq' => '0100',
|
||||
'nex' => '0100',
|
||||
'nf' => '010',
|
||||
'ng' => '010',
|
||||
'nh' => '010',
|
||||
'ni' => '100',
|
||||
'niq' => '0100',
|
||||
'nisp' => '00300',
|
||||
'nit' => '0200',
|
||||
'nj' => '010',
|
||||
'nl' => '010',
|
||||
'nm' => '010',
|
||||
'nn' => '012',
|
||||
'no' => '100',
|
||||
'nobl' => '00040',
|
||||
'nosp' => '03340',
|
||||
'nox' => '0100',
|
||||
'nq' => '010',
|
||||
'nr' => '010',
|
||||
'ns' => '010',
|
||||
'nsie' => '04300',
|
||||
'nsir' => '04000',
|
||||
'nsl' => '0200',
|
||||
'nst' => '0020',
|
||||
'nt' => '010',
|
||||
'ntah' => '04300',
|
||||
'ntap' => '04300',
|
||||
'nu' => '100',
|
||||
'nua' => '0010',
|
||||
'nue' => '0010',
|
||||
'nui' => '0010',
|
||||
'nv' => '010',
|
||||
'ny' => '100',
|
||||
'nz' => '010',
|
||||
'oa' => '010',
|
||||
'ob' => '010',
|
||||
'oblo' => '00300',
|
||||
'obs' => '1000',
|
||||
'oc' => '010',
|
||||
'ocle' => '00300',
|
||||
'od' => '010',
|
||||
'oe' => '010',
|
||||
'of' => '010',
|
||||
'og' => '010',
|
||||
'oh' => '010',
|
||||
'oi' => '010',
|
||||
'oj' => '010',
|
||||
'ol' => '010',
|
||||
'omna' => '00400',
|
||||
'ona' => '0020',
|
||||
'ono' => '0001',
|
||||
'onos' => '00004',
|
||||
'ons' => '0002',
|
||||
'oo' => '010',
|
||||
'op' => '010',
|
||||
'oq' => '010',
|
||||
'ora' => '0100',
|
||||
'ori' => '0100',
|
||||
'oro' => '0100',
|
||||
'orrh' => '00400',
|
||||
'oru' => '0100',
|
||||
'osl' => '0120',
|
||||
'ospo' => '00400',
|
||||
'ot' => '010',
|
||||
'otac' => '04300',
|
||||
'otos' => '00034',
|
||||
'ou' => '001',
|
||||
'oug' => '0100',
|
||||
'ov' => '010',
|
||||
'oy' => '001',
|
||||
'oz' => '010',
|
||||
'pa' => '100',
|
||||
'pans' => '00030',
|
||||
'pe' => '100',
|
||||
'ph' => '100',
|
||||
'pi' => '100',
|
||||
'pl' => '120',
|
||||
'pla' => '0040',
|
||||
'plop' => '40300',
|
||||
'pn' => '010',
|
||||
'pna' => '0210',
|
||||
'pne' => '0200',
|
||||
'po' => '100',
|
||||
'pp' => '210',
|
||||
'ppia' => '04300',
|
||||
'pr' => '120',
|
||||
'ps' => '210',
|
||||
'psod' => '04300',
|
||||
'psy' => '3200',
|
||||
'pt' => '210',
|
||||
'pu' => '100',
|
||||
'pub' => '0012',
|
||||
'pue' => '2010',
|
||||
'pui' => '0010',
|
||||
'pyl' => '0001',
|
||||
'pylo' => '00400',
|
||||
'qu' => '002',
|
||||
'quan' => '00040',
|
||||
'ralg' => '43000',
|
||||
'raq' => '2000',
|
||||
'rarc' => '43000',
|
||||
'rb' => '010',
|
||||
'rc' => '010',
|
||||
'rd' => '210',
|
||||
're' => '100',
|
||||
'rech' => '00300',
|
||||
'regi' => '00003',
|
||||
'renn' => '43000',
|
||||
'reut' => '00300',
|
||||
'rf' => '010',
|
||||
'rg' => '210',
|
||||
'rhi' => '1000',
|
||||
'rhu' => '0100',
|
||||
'rhyd' => '03000',
|
||||
'rj' => '010',
|
||||
'rl' => '010',
|
||||
'rm' => '210',
|
||||
'rn' => '010',
|
||||
'rp' => '010',
|
||||
'rq' => '010',
|
||||
'rr' => '010',
|
||||
'rraq' => '00300',
|
||||
'rs' => '012',
|
||||
'rt' => '210',
|
||||
'rua' => '0010',
|
||||
'rue' => '0010',
|
||||
'rui' => '0010',
|
||||
'rv' => '010',
|
||||
'rw' => '010',
|
||||
'ryse' => '00400',
|
||||
'rz' => '010',
|
||||
'sa' => '100',
|
||||
'sabu' => '03000',
|
||||
'sact' => '43000',
|
||||
'saf' => '2100',
|
||||
'sagr' => '03000',
|
||||
'sann' => '03000',
|
||||
'sap' => '2100',
|
||||
'saq' => '2100',
|
||||
'sarg' => '03000',
|
||||
'sarm' => '03000',
|
||||
'sart' => '03000',
|
||||
'sb' => '210',
|
||||
'sc' => '120',
|
||||
'scle' => '00004',
|
||||
'sd' => '010',
|
||||
'se' => '100',
|
||||
'sf' => '210',
|
||||
'sg' => '210',
|
||||
'sh' => '010',
|
||||
'si' => '100',
|
||||
'sige' => '43000',
|
||||
'siro' => '03000',
|
||||
'sj' => '010',
|
||||
'sk' => '100',
|
||||
'sl' => '010',
|
||||
'slav' => '04000',
|
||||
'sm' => '210',
|
||||
'sn' => '010',
|
||||
'so' => '100',
|
||||
'sob' => '0002',
|
||||
'sobe' => '03000',
|
||||
'sobl' => '03000',
|
||||
'socc' => '03000',
|
||||
'sodo' => '03000',
|
||||
'sord' => '03000',
|
||||
'sorg' => '03000',
|
||||
'soss' => '03000',
|
||||
'sox' => '2100',
|
||||
'sp' => '010',
|
||||
'spa' => '2000',
|
||||
'spai' => '00040',
|
||||
'spl' => '2000',
|
||||
'spo' => '2000',
|
||||
'sq' => '010',
|
||||
'sr' => '010',
|
||||
'ss' => '212',
|
||||
'ssa' => '0300',
|
||||
'st' => '010',
|
||||
'su' => '100',
|
||||
'sua' => '0010',
|
||||
'suba' => '00400',
|
||||
'subr' => '00400',
|
||||
'sue' => '0010',
|
||||
'sui' => '0010',
|
||||
'sun' => '2100',
|
||||
'sv' => '210',
|
||||
'sy' => '100',
|
||||
'talg' => '43000',
|
||||
'tamb' => '43000',
|
||||
'tart' => '43000',
|
||||
'td' => '210',
|
||||
'teco' => '43000',
|
||||
'tf' => '210',
|
||||
'tg' => '210',
|
||||
'thl' => '0010',
|
||||
'thm' => '2000',
|
||||
'tisp' => '00340',
|
||||
'tl' => '010',
|
||||
'tm' => '210',
|
||||
'tmo' => '0001',
|
||||
'tosp' => '00340',
|
||||
'toxy' => '43000',
|
||||
'tp' => '210',
|
||||
'tr' => '020',
|
||||
'tror' => '40300',
|
||||
'ts' => '210',
|
||||
'tt' => '210',
|
||||
'tua' => '0010',
|
||||
'tue' => '0010',
|
||||
'tui' => '0010',
|
||||
'tusa' => '00430',
|
||||
'ty' => '001',
|
||||
'tz' => '210',
|
||||
'uani' => '03000',
|
||||
'uas' => '0100',
|
||||
'uav' => '0100',
|
||||
'ubal' => '00300',
|
||||
'ubl' => '0010',
|
||||
'ubro' => '00300',
|
||||
'uca' => '0100',
|
||||
'uce' => '0100',
|
||||
'ucem' => '00300',
|
||||
'uch' => '0100',
|
||||
'uco' => '0100',
|
||||
'ucr' => '0100',
|
||||
'ucu' => '0100',
|
||||
'ud' => '010',
|
||||
'uel' => '0100',
|
||||
'uib' => '0100',
|
||||
'uic' => '0100',
|
||||
'ula' => '0100',
|
||||
'ule' => '0100',
|
||||
'ulo' => '0100',
|
||||
'uo' => '011',
|
||||
'ura' => '0100',
|
||||
'urgo' => '30000',
|
||||
'uri' => '0100',
|
||||
'uro' => '0100',
|
||||
'uru' => '0100',
|
||||
'ust' => '0200',
|
||||
'ut' => '010',
|
||||
'uu' => '010',
|
||||
'uv' => '010',
|
||||
'vai' => '0010',
|
||||
'viru' => '00300',
|
||||
'vn' => '200',
|
||||
'vr' => '020',
|
||||
'wn' => '021',
|
||||
'xa' => '010',
|
||||
'xc' => '010',
|
||||
'xe' => '010',
|
||||
'xh' => '010',
|
||||
'xi' => '010',
|
||||
'xo' => '010',
|
||||
'xp' => '010',
|
||||
'xq' => '010',
|
||||
'xs' => '012',
|
||||
'xt' => '010',
|
||||
'xu' => '010',
|
||||
'xua' => '0010',
|
||||
'xy' => '011',
|
||||
'xyl' => '1000',
|
||||
'ya' => '010',
|
||||
'yb' => '010',
|
||||
'yca' => '0010',
|
||||
'yce' => '0100',
|
||||
'ych' => '0001',
|
||||
'yco' => '0100',
|
||||
'ycta' => '00430',
|
||||
'ydr' => '0001',
|
||||
'ye' => '010',
|
||||
'yg' => '010',
|
||||
'yh' => '010',
|
||||
'yi' => '010',
|
||||
'yl' => '200',
|
||||
'ylac' => '03000',
|
||||
'ylam' => '00300',
|
||||
'yle' => '0100',
|
||||
'ylo' => '0100',
|
||||
'ynan' => '00300',
|
||||
'yneg' => '00300',
|
||||
'yo' => '010',
|
||||
'ypo' => '0001',
|
||||
'ypos' => '00004',
|
||||
'yr' => '010',
|
||||
'yro' => '0001',
|
||||
'yros' => '00004',
|
||||
'yse' => '0010',
|
||||
'yt' => '010',
|
||||
'yu' => '010',
|
||||
'yz' => '010',
|
||||
'ze' => '001',
|
||||
'zi' => '100',
|
||||
'zu' => '101',
|
||||
'zz' => '210',
|
||||
),
|
||||
);
|
||||
|
||||
348
site/OFF_plugins/typography/php-typography/lang/id.php
Normal file
348
site/OFF_plugins/typography/php-typography/lang/id.php
Normal file
|
|
@ -0,0 +1,348 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Project: wp-Typography
|
||||
Project URI: https://code.mundschenk.at/wp-typography/
|
||||
|
||||
File modified to place pattern and exceptions in arrays that can be understood in php files.
|
||||
This file is released under the same copyright as the below referenced original file
|
||||
Original unmodified file is available at: http://ctan.mirrorcatalogs.com/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex
|
||||
Original file name: hyph-id.tex
|
||||
|
||||
//============================================================================================================
|
||||
ORIGINAL FILE INFO
|
||||
|
||||
% This file is part of hyph-utf8 package and resulted from
|
||||
% semi-manual conversions of hyphenation patterns into UTF-8 in June 2008.
|
||||
%
|
||||
% Source: inhyph.tex (1997-09-19)
|
||||
% Author: Jörg Knappen <knappen@vkpmzd.kph.uni-mainz.de>, Terry Mart <mart@kph.uni-mainz.de>
|
||||
%
|
||||
% The above mentioned file should become obsolete,
|
||||
% and the author of the original file should preferably modify this file instead.
|
||||
%
|
||||
% Modifications were needed in order to support native UTF-8 engines,
|
||||
% but functionality (hopefully) didn't change in any way, at least not intentionally.
|
||||
% This file is no longer stand-alone; at least for 8-bit engines
|
||||
% you probably want to use loadhyph-foo.tex (which will load this file) instead.
|
||||
%
|
||||
% Modifications were done by Jonathan Kew, Mojca Miklavec & Arthur Reutenauer
|
||||
% with help & support from:
|
||||
% - Karl Berry, who gave us free hands and all resources
|
||||
% - Taco Hoekwater, with useful macros
|
||||
% - Hans Hagen, who did the unicodification of patterns already long before
|
||||
% and helped with testing, suggestions and bug reports
|
||||
% - Norbert Preining, who tested & integrated patterns into TeX Live
|
||||
%
|
||||
% However, the "copyright/copyleft" owner of patterns remains the original author.
|
||||
%
|
||||
% The copyright statement of this file is thus:
|
||||
%
|
||||
% Do with this file whatever needs to be done in future for the sake of
|
||||
% "a better world" as long as you respect the copyright of original file.
|
||||
% If you're the original author of patterns or taking over a new revolution,
|
||||
% plese remove all of the TUG comments & credits that we added here -
|
||||
% you are the Queen / the King, we are only the servants.
|
||||
%
|
||||
% If you want to change this file, rather than uploading directly to CTAN,
|
||||
% we would be grateful if you could send it to us (http://tug.org/tex-hyphen)
|
||||
% or ask for credentials for SVN repository and commit it yourself;
|
||||
% we will then upload the whole "package" to CTAN.
|
||||
%
|
||||
% Before a new "pattern-revolution" starts,
|
||||
% please try to follow some guidelines if possible:
|
||||
%
|
||||
% - \lccode is *forbidden*, and I really mean it
|
||||
% - all the patterns should be in UTF-8
|
||||
% - the only "allowed" TeX commands in this file are: \patterns, \hyphenation,
|
||||
% and if you really cannot do without, also \input and \message
|
||||
% - in particular, please no \catcode or \lccode changes,
|
||||
% they belong to loadhyph-foo.tex,
|
||||
% and no \lefthyphenmin and \righthyphenmin,
|
||||
% they have no influence here and belong elsewhere
|
||||
% - \begingroup and/or \endinput is not needed
|
||||
% - feel free to do whatever you want inside comments
|
||||
%
|
||||
% We know that TeX is extremely powerful, but give a stupid parser
|
||||
% at least a chance to read your patterns.
|
||||
%
|
||||
% For more unformation see
|
||||
%
|
||||
% http://tug.org/tex-hyphen
|
||||
%
|
||||
%------------------------------------------------------------------------------
|
||||
%
|
||||
% inhyph.tex
|
||||
% Version 1.3 19-SEP-1997
|
||||
%
|
||||
% Hyphenation patterns for bahasa indonesia (probably also usable
|
||||
% for bahasa melayu)
|
||||
%
|
||||
% (c) Copyright 1996, 1997 Jörg Knappen and Terry Mart
|
||||
%
|
||||
% This patterns are free software according to the GNU General Public
|
||||
% licence version 2, June 1991.
|
||||
%
|
||||
% Please read the GNU licence for details. If you don't receive a GNU
|
||||
% licence with these patterns, you can obtain it from
|
||||
%
|
||||
% Free Software Foundation, Inc.
|
||||
% 675 Mass Ave, Cambridge, MA 02139, USA
|
||||
%
|
||||
% If you make any changes to this file, please rename it so that it
|
||||
% cannot be confused with the original one, and change the contact
|
||||
% address for bug reports and suggestions.
|
||||
%
|
||||
% For bug reports, improvements, and suggestions, contact
|
||||
%
|
||||
% Jörg Knappen
|
||||
% jk Unternehmensberatung
|
||||
% Barbarossaring 43
|
||||
% 55118 Mainz
|
||||
%
|
||||
% knappen@vkpmzd.kph.uni-mainz.de
|
||||
%
|
||||
% or:
|
||||
% Terry Mart
|
||||
%
|
||||
% Institut fuer Kernphysik
|
||||
% Universitaet Mainz
|
||||
% 55099 Mainz
|
||||
% Germany
|
||||
%
|
||||
% phone : +49 6131 395174
|
||||
% fax : +49 6131 395474
|
||||
% email : mart@kph.uni-mainz.de
|
||||
%
|
||||
%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*
|
||||
%
|
||||
% The patterns are best used with the following parameters
|
||||
%
|
||||
% \lefthyphenmin=2 \righthyphenmin=2 %
|
||||
%
|
||||
%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*
|
||||
%
|
||||
% Exeptions to the above rules, specially words beginning in ber...
|
||||
% and ter..
|
||||
|
||||
|
||||
//============================================================================================================
|
||||
|
||||
*/
|
||||
|
||||
$patgenLanguage = 'Indonesian';
|
||||
|
||||
$patgenExceptions = array(
|
||||
'berabe' => 'be-ra-be',
|
||||
'berahi' => 'be-ra-hi',
|
||||
'berak' => 'be-rak',
|
||||
'beranda' => 'be-ran-da',
|
||||
'berandal' => 'be-ran-dal',
|
||||
'berang' => 'be-rang',
|
||||
'berangasan' => 'be-ra-ngas-an',
|
||||
'berangsang' => 'be-rang-sang',
|
||||
'berangus' => 'be-ra-ngus',
|
||||
'berani' => 'be-ra-ni',
|
||||
'berantakan' => 'be-ran-tak-an',
|
||||
'berantam' => 'be-ran-tam',
|
||||
'berantas' => 'be-ran-tas',
|
||||
'berapa' => 'be-ra-pa',
|
||||
'beras' => 'be-ras',
|
||||
'berendeng' => 'be-ren-deng',
|
||||
'berengut' => 'be-re-ngut',
|
||||
'bererot' => 'be-re-rot',
|
||||
'beres' => 'be-res',
|
||||
'berewok' => 'be-re-wok',
|
||||
'beri' => 'be-ri',
|
||||
'beringas' => 'be-ri-ngas',
|
||||
'berisik' => 'be-ri-sik',
|
||||
'berita' => 'be-ri-ta',
|
||||
'berok' => 'be-rok',
|
||||
'berondong' => 'be-ron-dong',
|
||||
'berontak' => 'be-ron-tak',
|
||||
'berudu' => 'be-ru-du',
|
||||
'beruk' => 'be-ruk',
|
||||
'beruntun' => 'be-run-tun',
|
||||
'pengekspor' => 'peng-eks-por',
|
||||
'pengimpor' => 'peng-im-por',
|
||||
'tera' => 'te-ra',
|
||||
'terang' => 'te-rang',
|
||||
'teras' => 'te-ras',
|
||||
'terasi' => 'te-ra-si',
|
||||
'teratai' => 'te-ra-tai',
|
||||
'terawang' => 'te-ra-wang',
|
||||
'teraweh' => 'te-ra-weh',
|
||||
'teriak' => 'te-ri-ak',
|
||||
'terigu' => 'te-ri-gu',
|
||||
'terik' => 'te-rik',
|
||||
'terima' => 'te-ri-ma',
|
||||
'teripang' => 'te-ri-pang',
|
||||
'terobos' => 'te-ro-bos',
|
||||
'terobosan' => 'te-ro-bos-an',
|
||||
'teromol' => 'te-ro-mol',
|
||||
'terompah' => 'te-rom-pah',
|
||||
'terompet' => 'te-rom-pet',
|
||||
'teropong' => 'te-ro-pong',
|
||||
'terowongan' => 'te-ro-wong-an',
|
||||
'terubuk' => 'te-ru-buk',
|
||||
'teruna' => 'te-ru-na',
|
||||
'terus' => 'te-rus',
|
||||
'terusi' => 'te-ru-si',
|
||||
);
|
||||
|
||||
$patgenMaxSeg = 6;
|
||||
|
||||
$patgen = array(
|
||||
'begin' => array(
|
||||
'ber' => '0023',
|
||||
'ter' => '0023',
|
||||
'meng' => '00203',
|
||||
'per' => '0023',
|
||||
'atau' => '02020',
|
||||
'tangan' => '0030400',
|
||||
'lengan' => '0030400',
|
||||
'jangan' => '0030400',
|
||||
'mangan' => '0030400',
|
||||
'pangan' => '0030400',
|
||||
'ringan' => '0030400',
|
||||
'dengan' => '0030400',
|
||||
),
|
||||
|
||||
'end' => array(
|
||||
'ng' => '200',
|
||||
'ny' => '200',
|
||||
'ban' => '2100',
|
||||
'can' => '2100',
|
||||
'dan' => '2100',
|
||||
'fan' => '2100',
|
||||
'gan' => '2100',
|
||||
'han' => '2100',
|
||||
'jan' => '2100',
|
||||
'kan' => '2100',
|
||||
'lan' => '2100',
|
||||
'man' => '2100',
|
||||
'ngan' => '20100',
|
||||
'nan' => '2100',
|
||||
'pan' => '2100',
|
||||
'ran' => '2100',
|
||||
'san' => '2100',
|
||||
'tan' => '2100',
|
||||
'van' => '2100',
|
||||
'zan' => '2100',
|
||||
'an' => '300',
|
||||
),
|
||||
|
||||
'all' => array(
|
||||
'a' => '01',
|
||||
'e' => '01',
|
||||
'i' => '01',
|
||||
'o' => '01',
|
||||
'u' => '01',
|
||||
'bd' => '210',
|
||||
'bj' => '210',
|
||||
'bk' => '210',
|
||||
'bn' => '210',
|
||||
'bs' => '210',
|
||||
'bt' => '210',
|
||||
'ck' => '210',
|
||||
'cn' => '210',
|
||||
'dk' => '210',
|
||||
'dn' => '210',
|
||||
'dp' => '210',
|
||||
'fd' => '210',
|
||||
'fk' => '210',
|
||||
'fn' => '210',
|
||||
'ft' => '210',
|
||||
'gg' => '210',
|
||||
'gk' => '210',
|
||||
'gn' => '210',
|
||||
'hk' => '210',
|
||||
'hl' => '210',
|
||||
'hm' => '210',
|
||||
'hn' => '210',
|
||||
'hw' => '210',
|
||||
'jk' => '210',
|
||||
'jn' => '210',
|
||||
'kb' => '210',
|
||||
'kk' => '210',
|
||||
'km' => '210',
|
||||
'kn' => '210',
|
||||
'kr' => '210',
|
||||
'ks' => '210',
|
||||
'kt' => '210',
|
||||
'lb' => '210',
|
||||
'lf' => '210',
|
||||
'lg' => '210',
|
||||
'lh' => '210',
|
||||
'lk' => '210',
|
||||
'lm' => '210',
|
||||
'ln' => '210',
|
||||
'ls' => '210',
|
||||
'lt' => '210',
|
||||
'lq' => '210',
|
||||
'mb' => '210',
|
||||
'mk' => '210',
|
||||
'ml' => '210',
|
||||
'mm' => '210',
|
||||
'mn' => '210',
|
||||
'mp' => '210',
|
||||
'mr' => '210',
|
||||
'ms' => '210',
|
||||
'nc' => '210',
|
||||
'nd' => '210',
|
||||
'nf' => '210',
|
||||
'nj' => '210',
|
||||
'nk' => '210',
|
||||
'nn' => '210',
|
||||
'np' => '210',
|
||||
'ns' => '210',
|
||||
'nt' => '210',
|
||||
'nv' => '210',
|
||||
'pk' => '210',
|
||||
'pn' => '210',
|
||||
'pp' => '210',
|
||||
'pr' => '210',
|
||||
'pt' => '210',
|
||||
'rb' => '210',
|
||||
'rc' => '210',
|
||||
'rf' => '210',
|
||||
'rg' => '210',
|
||||
'rh' => '210',
|
||||
'rj' => '210',
|
||||
'rk' => '210',
|
||||
'rl' => '210',
|
||||
'rm' => '210',
|
||||
'rn' => '210',
|
||||
'rp' => '210',
|
||||
'rr' => '210',
|
||||
'rs' => '210',
|
||||
'rt' => '210',
|
||||
'rw' => '210',
|
||||
'ry' => '210',
|
||||
'sb' => '210',
|
||||
'sk' => '210',
|
||||
'sl' => '210',
|
||||
'sm' => '210',
|
||||
'sn' => '210',
|
||||
'sp' => '210',
|
||||
'sr' => '210',
|
||||
'ss' => '210',
|
||||
'st' => '210',
|
||||
'sw' => '210',
|
||||
'tk' => '210',
|
||||
'tl' => '210',
|
||||
'tn' => '210',
|
||||
'tt' => '210',
|
||||
'wt' => '210',
|
||||
'ngg' => '2010',
|
||||
'ngh' => '2010',
|
||||
'ngk' => '2010',
|
||||
'ngn' => '2010',
|
||||
'ngs' => '2010',
|
||||
'nst' => '2320',
|
||||
'ion' => '0210',
|
||||
'air' => '0200',
|
||||
'bagai' => '101020',
|
||||
),
|
||||
);
|
||||
|
||||
4301
site/OFF_plugins/typography/php-typography/lang/is.php
Normal file
4301
site/OFF_plugins/typography/php-typography/lang/is.php
Normal file
File diff suppressed because it is too large
Load diff
435
site/OFF_plugins/typography/php-typography/lang/it.php
Normal file
435
site/OFF_plugins/typography/php-typography/lang/it.php
Normal file
|
|
@ -0,0 +1,435 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Project: wp-Typography
|
||||
Project URI: https://code.mundschenk.at/wp-typography/
|
||||
|
||||
File modified to place pattern and exceptions in arrays that can be understood in php files.
|
||||
This file is released under the same copyright as the below referenced original file
|
||||
Original unmodified file is available at: http://ctan.mirrorcatalogs.com/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex
|
||||
Original file name: hyph-it.tex
|
||||
|
||||
//============================================================================================================
|
||||
ORIGINAL FILE INFO
|
||||
|
||||
% hyph-it.tex
|
||||
%
|
||||
% Italian hyphenation patterns
|
||||
%
|
||||
% This file is part of the hyph-utf8 package.
|
||||
% For more unformation see
|
||||
%
|
||||
% http://tug.org/tex-hyphen
|
||||
%
|
||||
%------------------------------------------------------------------------------
|
||||
%
|
||||
%% Copyright 2008-2011 Claudio Beccari
|
||||
%
|
||||
% This work may be distributed and/or modified under the
|
||||
% conditions of the LaTeX Project Public License, either
|
||||
% version 1.3 of this license or (at your option) any later
|
||||
% version. The latest version of this license is in
|
||||
% http://www.latex-project.org/lppl.txt
|
||||
% and version 1.3 or later is part of all distributions
|
||||
% of LaTeX version 2003/12/01 or later.
|
||||
%
|
||||
% This work has the LPPL maintenance status "maintained".
|
||||
%
|
||||
% This Current Maintainer of this work is Claudio Beccari
|
||||
% e-mail: claudio dot beccari at gmail dot com
|
||||
%
|
||||
% This work consists of the single file hyph-it.tex.
|
||||
%
|
||||
% \versionnumber{4.9} \versiondate{2014/04/22}
|
||||
%
|
||||
% These hyphenation patterns for the Italian language are supposed to comply
|
||||
% with the Recommendation UNI 6461 on hyphenation issued by the Italian
|
||||
% Standards Institution (Ente Nazionale di Unificazione UNI). No guarantee
|
||||
% or declaration of fitness to any particular purpose is given and any
|
||||
% liability is disclaimed.
|
||||
%
|
||||
% ChangeLog:
|
||||
% - 2014-04-22 - Add few patterns involving `h'
|
||||
% - 2011-08-16 - Change the licence from GNU LGPL into LPPL v1.3.
|
||||
% - 2010-05-24 - Fix for Italian patterns for proper hyphenation of -ich and Ljubljana.
|
||||
% - 2008-06-09 - Import of original ithyph.tex into hyph-utf8 package.
|
||||
% - 2008-03-08 - (last change in ithyph.tex)
|
||||
%
|
||||
|
||||
|
||||
//============================================================================================================
|
||||
|
||||
*/
|
||||
|
||||
$patgenLanguage = 'Italian';
|
||||
|
||||
$patgenExceptions = array();
|
||||
|
||||
$patgenMaxSeg = 7;
|
||||
|
||||
$patgen = array(
|
||||
'begin' => array(
|
||||
'apn' => '0320',
|
||||
'anti' => '00001',
|
||||
'antimn' => '0000320',
|
||||
'bio' => '0001',
|
||||
'caps' => '00430',
|
||||
'circum' => '0000021',
|
||||
'contro' => '0000001',
|
||||
'discine' => '00230000',
|
||||
'exeu' => '02100',
|
||||
'frank' => '000023',
|
||||
'free' => '00003',
|
||||
'lipsa' => '003200',
|
||||
'narco' => '000001',
|
||||
'opto' => '00001',
|
||||
'ortop' => '000032',
|
||||
'para' => '00001',
|
||||
'phl' => '0020',
|
||||
'phr' => '0020',
|
||||
'polip' => '000032',
|
||||
'pre' => '0001',
|
||||
'ps' => '020',
|
||||
'reiscr' => '0012000',
|
||||
'share' => '000203',
|
||||
'transc' => '0000230',
|
||||
'transd' => '0000230',
|
||||
'transl' => '0000230',
|
||||
'transn' => '0000230',
|
||||
'transp' => '0000230',
|
||||
'transr' => '0000230',
|
||||
'transt' => '0000230',
|
||||
'sublu' => '002300',
|
||||
'subr' => '00230',
|
||||
'wagn' => '00230',
|
||||
'welt' => '00021',
|
||||
'c' => '02',
|
||||
'd' => '02',
|
||||
'h' => '02',
|
||||
'j' => '02',
|
||||
'k' => '02',
|
||||
't' => '02',
|
||||
'z' => '02',
|
||||
),
|
||||
|
||||
'end' => array(
|
||||
'at' => '200',
|
||||
'b' => '20',
|
||||
'ch' => '200',
|
||||
'ch\'' => '2000',
|
||||
'ch\'\'' => '20000',
|
||||
'c' => '20',
|
||||
'd' => '20',
|
||||
'f' => '20',
|
||||
'g' => '20',
|
||||
'h' => '20',
|
||||
'j' => '20',
|
||||
'k' => '20',
|
||||
'l' => '20',
|
||||
'l\'' => '200',
|
||||
'm' => '20',
|
||||
'n' => '20',
|
||||
'p' => '20',
|
||||
'q' => '20',
|
||||
'r' => '20',
|
||||
'sh' => '200',
|
||||
's' => '40',
|
||||
's\'' => '400',
|
||||
'th' => '200',
|
||||
't' => '20',
|
||||
't\'' => '200',
|
||||
'v' => '20',
|
||||
'v\'' => '200',
|
||||
'w' => '20',
|
||||
'x' => '20',
|
||||
'z' => '20',
|
||||
'z\'' => '200',
|
||||
),
|
||||
|
||||
'all' => array(
|
||||
'\'' => '22',
|
||||
'aia' => '0100',
|
||||
'aie' => '0100',
|
||||
'aio' => '0100',
|
||||
'aiu' => '0100',
|
||||
'auo' => '0100',
|
||||
'aya' => '0100',
|
||||
'eiu' => '0100',
|
||||
'ew' => '020',
|
||||
'oia' => '0100',
|
||||
'oie' => '0100',
|
||||
'oio' => '0100',
|
||||
'oiu' => '0100',
|
||||
'b' => '10',
|
||||
'bb' => '200',
|
||||
'bc' => '200',
|
||||
'bd' => '200',
|
||||
'bf' => '200',
|
||||
'bm' => '200',
|
||||
'bn' => '200',
|
||||
'bp' => '200',
|
||||
'bs' => '200',
|
||||
'bt' => '200',
|
||||
'bv' => '200',
|
||||
'bl' => '020',
|
||||
'br' => '020',
|
||||
'b\'' => '200',
|
||||
'c' => '10',
|
||||
'cb' => '200',
|
||||
'cc' => '200',
|
||||
'cd' => '200',
|
||||
'cf' => '200',
|
||||
'ck' => '200',
|
||||
'cm' => '200',
|
||||
'cn' => '200',
|
||||
'cq' => '200',
|
||||
'cs' => '200',
|
||||
'ct' => '200',
|
||||
'cz' => '200',
|
||||
'chh' => '2000',
|
||||
'ch' => '020',
|
||||
'chb' => '2000',
|
||||
'chr' => '0020',
|
||||
'chn' => '2000',
|
||||
'cl' => '020',
|
||||
'cr' => '020',
|
||||
'c\'' => '200',
|
||||
'd' => '10',
|
||||
'db' => '200',
|
||||
'dd' => '200',
|
||||
'dg' => '200',
|
||||
'dl' => '200',
|
||||
'dm' => '200',
|
||||
'dn' => '200',
|
||||
'dp' => '200',
|
||||
'dr' => '020',
|
||||
'ds' => '200',
|
||||
'dt' => '200',
|
||||
'dv' => '200',
|
||||
'dw' => '200',
|
||||
'd\'' => '200',
|
||||
'f' => '10',
|
||||
'fb' => '200',
|
||||
'fg' => '200',
|
||||
'ff' => '200',
|
||||
'fn' => '200',
|
||||
'fl' => '020',
|
||||
'fr' => '020',
|
||||
'fs' => '200',
|
||||
'ft' => '200',
|
||||
'f\'' => '200',
|
||||
'g' => '10',
|
||||
'gb' => '200',
|
||||
'gd' => '200',
|
||||
'gf' => '200',
|
||||
'gg' => '200',
|
||||
'gh' => '020',
|
||||
'gl' => '020',
|
||||
'gm' => '200',
|
||||
'gn' => '020',
|
||||
'gp' => '200',
|
||||
'gr' => '020',
|
||||
'gs' => '200',
|
||||
'gt' => '200',
|
||||
'gv' => '200',
|
||||
'gw' => '200',
|
||||
'gz' => '200',
|
||||
'ght' => '2020',
|
||||
'g\'' => '200',
|
||||
'h' => '10',
|
||||
'hb' => '200',
|
||||
'hd' => '200',
|
||||
'hh' => '200',
|
||||
'hipn' => '00320',
|
||||
'hl' => '020',
|
||||
'hm' => '200',
|
||||
'hn' => '200',
|
||||
'hr' => '200',
|
||||
'hv' => '200',
|
||||
'h\'' => '200',
|
||||
'j' => '10',
|
||||
'j\'' => '200',
|
||||
'k' => '10',
|
||||
'kg' => '200',
|
||||
'kf' => '200',
|
||||
'kh' => '020',
|
||||
'kk' => '200',
|
||||
'kl' => '020',
|
||||
'km' => '200',
|
||||
'kr' => '020',
|
||||
'ks' => '200',
|
||||
'kt' => '200',
|
||||
'k\'' => '200',
|
||||
'l' => '10',
|
||||
'lb' => '200',
|
||||
'lc' => '200',
|
||||
'ld' => '200',
|
||||
'lf' => '232',
|
||||
'lg' => '200',
|
||||
'lh' => '020',
|
||||
'lj' => '020',
|
||||
'lk' => '200',
|
||||
'll' => '200',
|
||||
'lm' => '200',
|
||||
'ln' => '200',
|
||||
'lp' => '200',
|
||||
'lq' => '200',
|
||||
'lr' => '200',
|
||||
'ls' => '200',
|
||||
'lt' => '200',
|
||||
'lv' => '200',
|
||||
'lw' => '200',
|
||||
'lz' => '200',
|
||||
'l\'\'' => '2000',
|
||||
'm' => '10',
|
||||
'mb' => '200',
|
||||
'mc' => '200',
|
||||
'mf' => '200',
|
||||
'ml' => '200',
|
||||
'mm' => '200',
|
||||
'mn' => '200',
|
||||
'mp' => '200',
|
||||
'mq' => '200',
|
||||
'mr' => '200',
|
||||
'ms' => '200',
|
||||
'mt' => '200',
|
||||
'mv' => '200',
|
||||
'mw' => '200',
|
||||
'm\'' => '200',
|
||||
'n' => '10',
|
||||
'nb' => '200',
|
||||
'nc' => '200',
|
||||
'nd' => '200',
|
||||
'nf' => '200',
|
||||
'ng' => '200',
|
||||
'nk' => '200',
|
||||
'nl' => '200',
|
||||
'nm' => '200',
|
||||
'nn' => '200',
|
||||
'np' => '200',
|
||||
'nq' => '200',
|
||||
'nr' => '200',
|
||||
'ns' => '200',
|
||||
'nsfer' => '023000',
|
||||
'nt' => '200',
|
||||
'nv' => '200',
|
||||
'nz' => '200',
|
||||
'ngn' => '0230',
|
||||
'nheit' => '200000',
|
||||
'n\'' => '200',
|
||||
'p' => '10',
|
||||
'pd' => '200',
|
||||
'ph' => '020',
|
||||
'pl' => '020',
|
||||
'pn' => '200',
|
||||
'pne' => '3200',
|
||||
'pp' => '200',
|
||||
'pr' => '020',
|
||||
'ps' => '200',
|
||||
'psic' => '32000',
|
||||
'pt' => '200',
|
||||
'pz' => '200',
|
||||
'p\'' => '200',
|
||||
'q' => '10',
|
||||
'qq' => '200',
|
||||
'q\'' => '200',
|
||||
'r' => '10',
|
||||
'rb' => '200',
|
||||
'rc' => '200',
|
||||
'rd' => '200',
|
||||
'rf' => '200',
|
||||
'rh' => '020',
|
||||
'rg' => '200',
|
||||
'rk' => '200',
|
||||
'rl' => '200',
|
||||
'rm' => '200',
|
||||
'rn' => '200',
|
||||
'rp' => '200',
|
||||
'rq' => '200',
|
||||
'rr' => '200',
|
||||
'rs' => '200',
|
||||
'rt' => '200',
|
||||
'rts' => '0223',
|
||||
'rv' => '200',
|
||||
'rx' => '200',
|
||||
'rw' => '200',
|
||||
'rz' => '200',
|
||||
'r\'' => '200',
|
||||
's' => '12',
|
||||
'shm' => '2000',
|
||||
'sh\'' => '2000',
|
||||
'ss' => '230',
|
||||
'ssm' => '0430',
|
||||
'spn' => '2320',
|
||||
'stb' => '2000',
|
||||
'stc' => '2000',
|
||||
'std' => '2000',
|
||||
'stf' => '2000',
|
||||
'stg' => '2000',
|
||||
'stm' => '2000',
|
||||
'stn' => '2000',
|
||||
'stp' => '2000',
|
||||
'sts' => '2000',
|
||||
'stt' => '2000',
|
||||
'stv' => '2000',
|
||||
'sz' => '200',
|
||||
's\'\'' => '4000',
|
||||
't' => '10',
|
||||
'tb' => '200',
|
||||
'tc' => '200',
|
||||
'td' => '200',
|
||||
'tf' => '200',
|
||||
'tg' => '200',
|
||||
'th' => '020',
|
||||
'tl' => '020',
|
||||
'tm' => '200',
|
||||
'tn' => '200',
|
||||
'tp' => '200',
|
||||
'tr' => '020',
|
||||
'ts' => '020',
|
||||
'tsch' => '32000',
|
||||
'tt' => '200',
|
||||
'tts' => '0230',
|
||||
'tv' => '200',
|
||||
'tw' => '200',
|
||||
'tz' => '020',
|
||||
'tzk' => '2000',
|
||||
'tzs' => '0020',
|
||||
't\'\'' => '2000',
|
||||
'v' => '10',
|
||||
'vc' => '200',
|
||||
'vl' => '020',
|
||||
'vr' => '020',
|
||||
'vv' => '200',
|
||||
'v\'\'' => '2000',
|
||||
'w' => '10',
|
||||
'wh' => '020',
|
||||
'war' => '0020',
|
||||
'wy' => '210',
|
||||
'w\'' => '200',
|
||||
'x' => '10',
|
||||
'xb' => '200',
|
||||
'xc' => '200',
|
||||
'xf' => '200',
|
||||
'xh' => '200',
|
||||
'xm' => '200',
|
||||
'xp' => '200',
|
||||
'xt' => '200',
|
||||
'xw' => '200',
|
||||
'x\'' => '200',
|
||||
'you' => '0100',
|
||||
'yi' => '010',
|
||||
'z' => '10',
|
||||
'zb' => '200',
|
||||
'zd' => '200',
|
||||
'zl' => '200',
|
||||
'zn' => '200',
|
||||
'zp' => '200',
|
||||
'zt' => '200',
|
||||
'zs' => '200',
|
||||
'zv' => '200',
|
||||
'zz' => '200',
|
||||
'z\'\'' => '2000',
|
||||
),
|
||||
);
|
||||
|
||||
2181
site/OFF_plugins/typography/php-typography/lang/ka.php
Normal file
2181
site/OFF_plugins/typography/php-typography/lang/ka.php
Normal file
File diff suppressed because it is too large
Load diff
812
site/OFF_plugins/typography/php-typography/lang/la-classic.php
Normal file
812
site/OFF_plugins/typography/php-typography/lang/la-classic.php
Normal file
|
|
@ -0,0 +1,812 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Project: wp-Typography
|
||||
Project URI: https://code.mundschenk.at/wp-typography/
|
||||
|
||||
File modified to place pattern and exceptions in arrays that can be understood in php files.
|
||||
This file is released under the same copyright as the below referenced original file
|
||||
Original unmodified file is available at: http://ctan.mirrorcatalogs.com/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/
|
||||
Original file name: hyph-la-x-classic.tex
|
||||
|
||||
//============================================================================================================
|
||||
ORIGINAL FILE INFO
|
||||
|
||||
%
|
||||
% ********** hyph-la-x-classic.tex *************
|
||||
%
|
||||
% Copyright 2014 Claudio Beccari
|
||||
% [classical latin hyphenation patterns]
|
||||
%
|
||||
% -----------------------------------------------------------------
|
||||
% IMPORTANT NOTICE:
|
||||
%
|
||||
% This program can be redistributed and/or modified under the terms
|
||||
% of the LaTeX Project Public License Distributed from CTAN
|
||||
% archives in directory macros/latex/base/lppl.txt; either
|
||||
% version 1 of the License, or any later version.
|
||||
% -----------------------------------------------------------------
|
||||
%
|
||||
% Patterns for the classical Latin language; classical spelling
|
||||
% with the (uncial) lowercase `v' written as a `u' is supported.
|
||||
% Classical Latin hyphenation patterns are different from those of
|
||||
% "plain" Latin, the latter being more adapted to modern Latin.
|
||||
%
|
||||
%
|
||||
% Prepared by Claudio Beccari
|
||||
% e-mail claudio dot beccari at gmail dot com
|
||||
%
|
||||
% Aknowledgements: This file has been substantially upgraded with
|
||||
% the contributions of Francisco Gracia.
|
||||
%
|
||||
% \versionnumber{1.2} \versiondate{2014/10/06}
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
% \message{Classical Latin hyphenation patterns `hyph-la-x-classic'
|
||||
% Version 1.2 <2014/10/06>}
|
||||
%
|
||||
%
|
||||
|
||||
|
||||
//============================================================================================================
|
||||
|
||||
*/
|
||||
|
||||
$patgenLanguage = 'Latin (Classical)';
|
||||
|
||||
$patgenExceptions = array();
|
||||
|
||||
$patgenMaxSeg = 10;
|
||||
|
||||
$patgen = array(
|
||||
'begin' => array(
|
||||
'abl' => '0230',
|
||||
'anti' => '00001',
|
||||
'antimn' => '0000320',
|
||||
'aristo' => '0003200',
|
||||
'circum' => '0000021',
|
||||
'coniun' => '0021000',
|
||||
'ex' => '023',
|
||||
'exst' => '00020',
|
||||
'parai' => '000010',
|
||||
'parau' => '000010',
|
||||
'peri' => '00001',
|
||||
'quincun' => '00002300',
|
||||
'sublu' => '002300',
|
||||
'subr' => '00230',
|
||||
's' => '02',
|
||||
'stagn' => '000320',
|
||||
'ia' => '020',
|
||||
'ie' => '020',
|
||||
'ii' => '020',
|
||||
'io' => '020',
|
||||
'iu' => '020',
|
||||
'iuua' => '00020',
|
||||
'iuue' => '00020',
|
||||
'iuuo' => '00020',
|
||||
'ieiu' => '00020',
|
||||
'iaiu' => '00020',
|
||||
'iuui' => '00020',
|
||||
'uaua' => '00300',
|
||||
'uoue' => '00300',
|
||||
'ueio' => '00100',
|
||||
'ua' => '020',
|
||||
'ue' => '020',
|
||||
'ui' => '020',
|
||||
'uo' => '020',
|
||||
'uu' => '020',
|
||||
'b' => '02',
|
||||
'c' => '02',
|
||||
'g' => '02',
|
||||
'f' => '02',
|
||||
'huiu' => '00120',
|
||||
'h' => '02',
|
||||
'l' => '02',
|
||||
'm' => '02',
|
||||
'n' => '02',
|
||||
'p' => '02',
|
||||
'r' => '02',
|
||||
'sm' => '020',
|
||||
't' => '02',
|
||||
'x' => '02',
|
||||
'z' => '02',
|
||||
'abauu' => '021000',
|
||||
'abali' => '021000',
|
||||
'abic' => '02100',
|
||||
'abiec' => '021000',
|
||||
'abin' => '02101',
|
||||
'abiu' => '02100',
|
||||
'abol' => '02100',
|
||||
'abs' => '0020',
|
||||
'absi' => '00302',
|
||||
'abso' => '00300',
|
||||
'abste' => '003200',
|
||||
'absu' => '00302',
|
||||
'abes' => '02102',
|
||||
'aber' => '02102',
|
||||
'abfu' => '02000',
|
||||
'abru' => '02300',
|
||||
'abscin' => '0052000',
|
||||
'ad' => '021',
|
||||
'adsu' => '00002',
|
||||
'ades' => '02102',
|
||||
'adsi' => '00302',
|
||||
'ader' => '02102',
|
||||
'adfu' => '02000',
|
||||
'adst' => '00320',
|
||||
'agnas' => '032000',
|
||||
'asc' => '0320',
|
||||
'asp' => '0320',
|
||||
'ast' => '0320',
|
||||
'aperu' => '000320',
|
||||
'cis' => '0023',
|
||||
'coe' => '0010',
|
||||
'coi' => '0010',
|
||||
'coie' => '00120',
|
||||
'coiu' => '00030',
|
||||
'coen' => '00210',
|
||||
'coelec' => '0032000',
|
||||
'coelig' => '0032000',
|
||||
'coemen' => '0030000',
|
||||
'coer' => '00320',
|
||||
'coex' => '00323',
|
||||
'coexs' => '000032',
|
||||
'cogno' => '003200',
|
||||
'con' => '0021',
|
||||
'conic' => '000300',
|
||||
'conif' => '003200',
|
||||
'conig' => '003200',
|
||||
'conit' => '003200',
|
||||
'coniue' => '0032300',
|
||||
'conia' => '000020',
|
||||
'conie' => '000020',
|
||||
'conii' => '000020',
|
||||
'coniu' => '000020',
|
||||
'conscr' => '0003200',
|
||||
'consp' => '000322',
|
||||
'const' => '000320',
|
||||
'desc' => '00320',
|
||||
'desp' => '00320',
|
||||
'desq' => '00320',
|
||||
'dest' => '00320',
|
||||
'dignosc' => '00320000',
|
||||
'disi' => '00212',
|
||||
'disce' => '003200',
|
||||
'discept' => '00430030',
|
||||
'disp' => '00320',
|
||||
'disqua' => '0032000',
|
||||
'discr' => '003200',
|
||||
'dist' => '00320',
|
||||
'distend' => '00430010',
|
||||
'distinc' => '00430400',
|
||||
'idci' => '02000',
|
||||
'idiog' => '030200',
|
||||
'in' => '021',
|
||||
'insp' => '00320',
|
||||
'inst' => '00320',
|
||||
'inan' => '03200',
|
||||
'inabr' => '000230',
|
||||
'inabs' => '000032',
|
||||
'init' => '03200',
|
||||
'inacr' => '000200',
|
||||
'inadf' => '000200',
|
||||
'iners' => '032000',
|
||||
'inert' => '032000',
|
||||
'inex' => '00023',
|
||||
'inexst' => '0000020',
|
||||
'inob' => '00020',
|
||||
'inobsc' => '0000320',
|
||||
'inoboe' => '0003200',
|
||||
'inperiur' => '000023000',
|
||||
'inul' => '03200',
|
||||
'inulc' => '043000',
|
||||
'inua' => '00020',
|
||||
'inue' => '00020',
|
||||
'inui' => '00020',
|
||||
'inuo' => '00020',
|
||||
'inuu' => '00020',
|
||||
'iusiur' => '0023200',
|
||||
'ob' => '021',
|
||||
'obed' => '03200',
|
||||
'obel' => '03200',
|
||||
'obes' => '03200',
|
||||
'obic' => '03200',
|
||||
'obia' => '00020',
|
||||
'obie' => '00020',
|
||||
'obiu' => '00320',
|
||||
'obscu' => '003200',
|
||||
'obl' => '0030',
|
||||
'obr' => '0030',
|
||||
'obruz' => '034000',
|
||||
'obsc' => '00320',
|
||||
'obst' => '00320',
|
||||
'obtr' => '00300',
|
||||
'obua' => '00020',
|
||||
'obue' => '00020',
|
||||
'obui' => '00020',
|
||||
'obuo' => '00020',
|
||||
'perabsu' => '00210000',
|
||||
'perac' => '002100',
|
||||
'peradu' => '0021210',
|
||||
'peradp' => '0021200',
|
||||
'perae' => '002100',
|
||||
'perag' => '002300',
|
||||
'pererr' => '0023000',
|
||||
'peror' => '002300',
|
||||
'peru' => '00230',
|
||||
'perar' => '002100',
|
||||
'perau' => '002120',
|
||||
'pered' => '002100',
|
||||
'pereff' => '0021000',
|
||||
'peregr' => '0021000',
|
||||
'perel' => '002100',
|
||||
'perem' => '002100',
|
||||
'perenn' => '0032000',
|
||||
'pereru' => '0021000',
|
||||
'perex' => '002123',
|
||||
'perh' => '00230',
|
||||
'periac' => '0021200',
|
||||
'periec' => '0021200',
|
||||
'perips' => '0000320',
|
||||
'peript' => '0000320',
|
||||
'perisc' => '0000320',
|
||||
'perist' => '0000320',
|
||||
'perobsc' => '00212320',
|
||||
'perod' => '002100',
|
||||
'perof' => '002100',
|
||||
'perol' => '002100',
|
||||
'perop' => '002100',
|
||||
'perseu' => '0000020',
|
||||
'persei' => '0000020',
|
||||
'perseo' => '0000020',
|
||||
'persc' => '002320',
|
||||
'persp' => '002320',
|
||||
'perst' => '002320',
|
||||
'pertrans' => '002300021',
|
||||
'perua' => '002120',
|
||||
'perue' => '002120',
|
||||
'perui' => '002120',
|
||||
'peruo' => '002120',
|
||||
'prae' => '00001',
|
||||
'praeau' => '0000020',
|
||||
'praesc' => '0000320',
|
||||
'praesp' => '0000320',
|
||||
'praest' => '0000320',
|
||||
'praeua' => '0000020',
|
||||
'praeue' => '0000020',
|
||||
'praeui' => '0000020',
|
||||
'praeuo' => '0000020',
|
||||
'praeter' => '00000021',
|
||||
'praeterue' => '0000000020',
|
||||
'praeteruo' => '0000000020',
|
||||
'primi' => '000001',
|
||||
'primisc' => '00000320',
|
||||
'prodess' => '00021030',
|
||||
'prodig' => '0002100',
|
||||
'prodeamb' => '000101000',
|
||||
'prodeo' => '0002100',
|
||||
'prodis' => '0002300',
|
||||
'prodit' => '0002100',
|
||||
'prodim' => '0002100',
|
||||
'prodeun' => '00021000',
|
||||
'prodir' => '0002100',
|
||||
'prodib' => '0002100',
|
||||
'prodier' => '00021000',
|
||||
'prodea' => '0002100',
|
||||
'prodito' => '00032000',
|
||||
'proditi' => '00032000',
|
||||
'proditr' => '00032000',
|
||||
'progn' => '000320',
|
||||
'proin' => '000300',
|
||||
'prosc' => '000320',
|
||||
'prosp' => '000320',
|
||||
'prost' => '000320',
|
||||
'quotan' => '0002100',
|
||||
'quoten' => '0002100',
|
||||
'quotie' => '0002120',
|
||||
'quotli' => '0002300',
|
||||
'redac' => '002100',
|
||||
'redad' => '002100',
|
||||
'redam' => '002100',
|
||||
'redan' => '002100',
|
||||
'redar' => '002100',
|
||||
'redau' => '002120',
|
||||
'redem' => '002100',
|
||||
'redeo' => '002100',
|
||||
'redis' => '002500',
|
||||
'redit' => '002500',
|
||||
'redimi' => '0043000',
|
||||
'redeu' => '002100',
|
||||
'redier' => '0021000',
|
||||
'redib' => '002100',
|
||||
'redien' => '0021000',
|
||||
'redic' => '003200',
|
||||
'redig' => '003200',
|
||||
'redim' => '003200',
|
||||
'redin' => '002100',
|
||||
'redol' => '002100',
|
||||
'redop' => '002100',
|
||||
'redorm' => '0032000',
|
||||
'redorn' => '0021000',
|
||||
'redul' => '002100',
|
||||
'redord' => '0021000',
|
||||
'redarg' => '0021000',
|
||||
'redamb' => '0021000',
|
||||
'reex' => '00020',
|
||||
'reie' => '00100',
|
||||
'rein' => '00100',
|
||||
'repau' => '000020',
|
||||
'rescr' => '003200',
|
||||
'resp' => '00320',
|
||||
'restag' => '0032000',
|
||||
'restau' => '0032020',
|
||||
'restib' => '0032000',
|
||||
'restic' => '0032000',
|
||||
'restil' => '0032000',
|
||||
'restip' => '0032000',
|
||||
'restr' => '003200',
|
||||
'satis' => '000021',
|
||||
'satag' => '002100',
|
||||
'sescun' => '0002140',
|
||||
'sicut' => '002142',
|
||||
'sisten' => '0032000',
|
||||
'subic' => '002100',
|
||||
'subingr' => '00210000',
|
||||
'subodo' => '0021000',
|
||||
'subst' => '002320',
|
||||
'superab' => '00002100',
|
||||
'superad' => '00002100',
|
||||
'superadst' => '0000210320',
|
||||
'superae' => '00002100',
|
||||
'superag' => '00002100',
|
||||
'superam' => '00002100',
|
||||
'superarg' => '000021000',
|
||||
'superasp' => '000021320',
|
||||
'superast' => '000021320',
|
||||
'superatt' => '000021000',
|
||||
'superbib' => '000021000',
|
||||
'superbif' => '000021000',
|
||||
'superbil' => '000021000',
|
||||
'superc' => '0000210',
|
||||
'superd' => '0000210',
|
||||
'supered' => '00002100',
|
||||
'supereff' => '000021000',
|
||||
'supereg' => '00002100',
|
||||
'superem' => '00002100',
|
||||
'superen' => '00002100',
|
||||
'superer' => '00002100',
|
||||
'supereu' => '00002100',
|
||||
'superex' => '00002123',
|
||||
'superh' => '0000230',
|
||||
'superi' => '0000232',
|
||||
'superil' => '00002100',
|
||||
'superim' => '00002100',
|
||||
'superin' => '00002100',
|
||||
'superir' => '00002100',
|
||||
'superiume' => '0000454000',
|
||||
'superio' => '00003430',
|
||||
'superiu' => '00003430',
|
||||
'superobd' => '000021210',
|
||||
'superobr' => '000021230',
|
||||
'superoc' => '00002100',
|
||||
'superor' => '00002100',
|
||||
'supersc' => '00002320',
|
||||
'supersp' => '00002320',
|
||||
'superst' => '00002320',
|
||||
'supersubst' => '00002100320',
|
||||
'superu' => '0000232',
|
||||
'suprasc' => '00000320',
|
||||
'susc' => '00320',
|
||||
'susp' => '00320',
|
||||
'susscr' => '0000200',
|
||||
'tetraet' => '00000320',
|
||||
'tetragn' => '00000320',
|
||||
'tetrast' => '00000320',
|
||||
'teriu' => '002120',
|
||||
'terun' => '002100',
|
||||
'terps' => '000020',
|
||||
'theo' => '00020',
|
||||
'theogn' => '0000320',
|
||||
'thesp' => '000320',
|
||||
'thest' => '000320',
|
||||
'thisb' => '000320',
|
||||
'traia' => '000120',
|
||||
'traie' => '000120',
|
||||
'traii' => '000100',
|
||||
'trans' => '000020',
|
||||
'transa' => '0000002',
|
||||
'transabi' => '000001210',
|
||||
'transabe' => '000001212',
|
||||
'transact' => '000001000',
|
||||
'transad' => '00000121',
|
||||
'transi' => '0000030',
|
||||
'transau' => '00000120',
|
||||
'transc' => '0000320',
|
||||
'transen' => '00003200',
|
||||
'transe' => '0000010',
|
||||
'transeu' => '00000020',
|
||||
'transo' => '0000012',
|
||||
'transu' => '0000012',
|
||||
'transum' => '00003200',
|
||||
'tranue' => '0002100',
|
||||
'trien' => '000300',
|
||||
'unius' => '021200',
|
||||
'uterui' => '0002300',
|
||||
'zaieu' => '002300',
|
||||
'zeugm' => '000320',
|
||||
),
|
||||
|
||||
'end' => array(
|
||||
'sque' => '23000',
|
||||
'sdem' => '23000',
|
||||
'ne' => '300',
|
||||
'sne' => '2000',
|
||||
'am' => '200',
|
||||
'at' => '200',
|
||||
'as' => '200',
|
||||
'ans' => '2000',
|
||||
'ax' => '200',
|
||||
'ant' => '4000',
|
||||
'es' => '200',
|
||||
'et' => '200',
|
||||
'em' => '200',
|
||||
'ex' => '200',
|
||||
'eus' => '0500',
|
||||
'is' => '200',
|
||||
'im' => '200',
|
||||
'it' => '200',
|
||||
'ix' => '200',
|
||||
'yx' => '200',
|
||||
'ys' => '200',
|
||||
'ox' => '200',
|
||||
'ui' => '200',
|
||||
'ux' => '200',
|
||||
'ium' => '0300',
|
||||
'iur' => '0300',
|
||||
'iunt' => '03000',
|
||||
'iui' => '0300',
|
||||
'truus' => '000500',
|
||||
'truum' => '000100',
|
||||
'b' => '20',
|
||||
'c' => '20',
|
||||
'd' => '20',
|
||||
'f' => '20',
|
||||
'g' => '20',
|
||||
'h' => '20',
|
||||
'l' => '20',
|
||||
'm' => '20',
|
||||
'n' => '20',
|
||||
'p' => '20',
|
||||
'r' => '20',
|
||||
's' => '20',
|
||||
'st' => '200',
|
||||
't' => '20',
|
||||
'x' => '20',
|
||||
'xit' => '1200',
|
||||
'xu' => '120',
|
||||
'xum' => '1200',
|
||||
'xus' => '1200',
|
||||
'z' => '20',
|
||||
'rus' => '3400',
|
||||
),
|
||||
|
||||
'all' => array(
|
||||
'psic' => '32000',
|
||||
'pneu' => '32000',
|
||||
'aua' => '0100',
|
||||
'aue' => '0100',
|
||||
'aui' => '0100',
|
||||
'auo' => '0100',
|
||||
'auu' => '0100',
|
||||
'eua' => '0100',
|
||||
'eue' => '0100',
|
||||
'eui' => '0100',
|
||||
'euo' => '0120',
|
||||
'euu' => '0100',
|
||||
'iua' => '0100',
|
||||
'iue' => '0100',
|
||||
'iui' => '0100',
|
||||
'iuo' => '0100',
|
||||
'iuu' => '0100',
|
||||
'oua' => '0100',
|
||||
'oue' => '0100',
|
||||
'oui' => '0100',
|
||||
'ouo' => '0100',
|
||||
'ouu' => '0100',
|
||||
'uua' => '0100',
|
||||
'uue' => '0100',
|
||||
'uui' => '0100',
|
||||
'uiu' => '0100',
|
||||
'uiua' => '02000',
|
||||
'uiue' => '02000',
|
||||
'uiui' => '02000',
|
||||
'uiuo' => '02000',
|
||||
'uuo' => '0100',
|
||||
'uuu' => '0320',
|
||||
'alua' => '02300',
|
||||
'alue' => '02300',
|
||||
'alui' => '02300',
|
||||
'aluo' => '02300',
|
||||
'aluu' => '02300',
|
||||
'elue' => '02300',
|
||||
'ilua' => '02300',
|
||||
'ilue' => '02300',
|
||||
'ilui' => '02300',
|
||||
'iluo' => '02300',
|
||||
'iluu' => '02300',
|
||||
'olua' => '02300',
|
||||
'olue' => '02300',
|
||||
'olui' => '02300',
|
||||
'oluo' => '02300',
|
||||
'oluu' => '02300',
|
||||
'ulua' => '02300',
|
||||
'uluo' => '02300',
|
||||
'uluu' => '02300',
|
||||
'aa' => '010',
|
||||
'ee' => '010',
|
||||
'ea' => '010',
|
||||
'eo' => '010',
|
||||
'ii' => '030',
|
||||
'oo' => '010',
|
||||
'uia' => '0010',
|
||||
'ais' => '0100',
|
||||
'cu' => '003',
|
||||
'aia' => '0100',
|
||||
'aie' => '0100',
|
||||
'aio' => '0100',
|
||||
'aiu' => '0100',
|
||||
'aea' => '0010',
|
||||
'aeo' => '0010',
|
||||
'aeu' => '0010',
|
||||
'eia' => '0100',
|
||||
'eie' => '0100',
|
||||
'eiu' => '0120',
|
||||
'ioi' => '0010',
|
||||
'oia' => '0100',
|
||||
'oie' => '0100',
|
||||
'oio' => '0100',
|
||||
'oiu' => '0100',
|
||||
'ioiu' => '02020',
|
||||
'iuia' => '03200',
|
||||
'iuiua' => '030300',
|
||||
'iuiue' => '030300',
|
||||
'iuiui' => '030300',
|
||||
'iuiuo' => '030300',
|
||||
'iuiuu' => '030300',
|
||||
'euiue' => '010100',
|
||||
'euiui' => '010100',
|
||||
'euiuo' => '010100',
|
||||
'iy' => '020',
|
||||
'uou' => '0030',
|
||||
'b' => '10',
|
||||
'bb' => '200',
|
||||
'bd' => '200',
|
||||
'bh' => '200',
|
||||
'bl' => '020',
|
||||
'bm' => '200',
|
||||
'bn' => '200',
|
||||
'bp' => '200',
|
||||
'br' => '020',
|
||||
'bt' => '200',
|
||||
'bs' => '200',
|
||||
'bst' => '0320',
|
||||
'c' => '10',
|
||||
'cc' => '200',
|
||||
'ch' => '022',
|
||||
'cl' => '020',
|
||||
'cm' => '200',
|
||||
'cn' => '200',
|
||||
'cq' => '200',
|
||||
'cr' => '020',
|
||||
'cs' => '200',
|
||||
'ct' => '200',
|
||||
'cz' => '200',
|
||||
'd' => '10',
|
||||
'dd' => '200',
|
||||
'dg' => '200',
|
||||
'df' => '200',
|
||||
'dm' => '200',
|
||||
'dr' => '020',
|
||||
'ds' => '200',
|
||||
'f' => '10',
|
||||
'ff' => '200',
|
||||
'fl' => '020',
|
||||
'fn' => '200',
|
||||
'fr' => '020',
|
||||
'ft' => '200',
|
||||
'g' => '10',
|
||||
'gg' => '200',
|
||||
'gd' => '200',
|
||||
'gf' => '200',
|
||||
'gl' => '020',
|
||||
'gm' => '200',
|
||||
'gn' => '200',
|
||||
'gr' => '020',
|
||||
'gs' => '200',
|
||||
'h' => '10',
|
||||
'hp' => '200',
|
||||
'ht' => '200',
|
||||
'k' => '10',
|
||||
'l' => '10',
|
||||
'lb' => '200',
|
||||
'lc' => '200',
|
||||
'ld' => '200',
|
||||
'lf' => '200',
|
||||
'lft' => '0320',
|
||||
'lg' => '200',
|
||||
'lk' => '200',
|
||||
'll' => '200',
|
||||
'lm' => '200',
|
||||
'ln' => '200',
|
||||
'lp' => '200',
|
||||
'lq' => '200',
|
||||
'lr' => '200',
|
||||
'ls' => '200',
|
||||
'lt' => '200',
|
||||
'm' => '10',
|
||||
'mm' => '200',
|
||||
'mb' => '200',
|
||||
'md' => '200',
|
||||
'ml' => '200',
|
||||
'mn' => '200',
|
||||
'mp' => '200',
|
||||
'mq' => '200',
|
||||
'mr' => '200',
|
||||
'ms' => '200',
|
||||
'mt' => '200',
|
||||
'n' => '10',
|
||||
'nb' => '200',
|
||||
'nc' => '200',
|
||||
'nd' => '200',
|
||||
'nf' => '200',
|
||||
'ng' => '200',
|
||||
'nl' => '200',
|
||||
'nm' => '200',
|
||||
'nn' => '200',
|
||||
'np' => '200',
|
||||
'nq' => '200',
|
||||
'nr' => '200',
|
||||
'ns' => '200',
|
||||
'nh' => '200',
|
||||
'nsm' => '0230',
|
||||
'nsf' => '0230',
|
||||
'nt' => '200',
|
||||
'nx' => '202',
|
||||
'p' => '10',
|
||||
'ph' => '022',
|
||||
'pl' => '020',
|
||||
'pn' => '200',
|
||||
'pp' => '200',
|
||||
'pr' => '020',
|
||||
'ps' => '200',
|
||||
'pt' => '200',
|
||||
'ptr' => '3200',
|
||||
'pz' => '200',
|
||||
'php' => '2000',
|
||||
'pht' => '2000',
|
||||
'qu' => '102',
|
||||
'r' => '10',
|
||||
'rb' => '200',
|
||||
'rc' => '200',
|
||||
'rd' => '200',
|
||||
'rf' => '200',
|
||||
'rg' => '200',
|
||||
'rh' => '020',
|
||||
'rl' => '200',
|
||||
'rm' => '200',
|
||||
'rn' => '200',
|
||||
'rp' => '200',
|
||||
'rq' => '200',
|
||||
'rr' => '230',
|
||||
'rs' => '200',
|
||||
'rt' => '200',
|
||||
'rz' => '200',
|
||||
'rx' => '210',
|
||||
's' => '10',
|
||||
'ss' => '230',
|
||||
'sb' => '200',
|
||||
'sc' => '200',
|
||||
'sd' => '200',
|
||||
'sf' => '200',
|
||||
'sg' => '200',
|
||||
'sl' => '020',
|
||||
'sm' => '200',
|
||||
'sn' => '200',
|
||||
'sr' => '020',
|
||||
'sp' => '200',
|
||||
'sq' => '200',
|
||||
'st' => '200',
|
||||
'sth' => '3200',
|
||||
'sph' => '3200',
|
||||
'sch' => '3200',
|
||||
'stl' => '2230',
|
||||
'stn' => '2300',
|
||||
'stp' => '2030',
|
||||
'stq' => '2230',
|
||||
'sts' => '2230',
|
||||
'stt' => '2230',
|
||||
't' => '10',
|
||||
'tb' => '200',
|
||||
'tc' => '200',
|
||||
'td' => '200',
|
||||
'tf' => '200',
|
||||
'tg' => '200',
|
||||
'th' => '022',
|
||||
'tl' => '020',
|
||||
'tr' => '020',
|
||||
'tm' => '200',
|
||||
'tn' => '200',
|
||||
'tp' => '200',
|
||||
'tq' => '200',
|
||||
'tt' => '200',
|
||||
'x' => '01',
|
||||
'xa' => '120',
|
||||
'xe' => '120',
|
||||
'xi' => '120',
|
||||
'xo' => '120',
|
||||
'xy' => '120',
|
||||
'xyst' => '00320',
|
||||
'xua' => '1020',
|
||||
'xue' => '1020',
|
||||
'xui' => '1020',
|
||||
'xuo' => '1020',
|
||||
'xuu' => '1020',
|
||||
'ycn' => '0320',
|
||||
'z' => '10',
|
||||
'amui' => '02300',
|
||||
'anua' => '02120',
|
||||
'anue' => '02120',
|
||||
'anui' => '02120',
|
||||
'anuo' => '02120',
|
||||
'anuu' => '02120',
|
||||
'enua' => '02120',
|
||||
'enue' => '02120',
|
||||
'enui' => '02120',
|
||||
'enuo' => '02120',
|
||||
'enuu' => '02120',
|
||||
'genua' => '003200',
|
||||
'inua' => '02120',
|
||||
'inue' => '02120',
|
||||
'inui' => '02120',
|
||||
'inuo' => '02120',
|
||||
'inuu' => '02120',
|
||||
'tinui' => '003200',
|
||||
'onua' => '02120',
|
||||
'onue' => '02120',
|
||||
'onui' => '02120',
|
||||
'onuo' => '02120',
|
||||
'onuu' => '02120',
|
||||
'unua' => '02120',
|
||||
'unue' => '02120',
|
||||
'unui' => '02120',
|
||||
'unuo' => '02120',
|
||||
'unuu' => '02120',
|
||||
'arua' => '02120',
|
||||
'arue' => '02120',
|
||||
'arui' => '02120',
|
||||
'aruo' => '02120',
|
||||
'aruu' => '02120',
|
||||
'erua' => '02120',
|
||||
'erue' => '02120',
|
||||
'erui' => '02120',
|
||||
'eruo' => '02120',
|
||||
'eruu' => '02120',
|
||||
'irua' => '02120',
|
||||
'irue' => '02120',
|
||||
'irui' => '02120',
|
||||
'iruo' => '02120',
|
||||
'iruu' => '02120',
|
||||
'orua' => '02120',
|
||||
'orue' => '02120',
|
||||
'orui' => '02120',
|
||||
'oruo' => '02120',
|
||||
'oruu' => '02120',
|
||||
'urua' => '02120',
|
||||
'urue' => '02120',
|
||||
'urui' => '02120',
|
||||
'uruo' => '02120',
|
||||
'uruu' => '02120',
|
||||
),
|
||||
);
|
||||
|
||||
478
site/OFF_plugins/typography/php-typography/lang/la.php
Normal file
478
site/OFF_plugins/typography/php-typography/lang/la.php
Normal file
|
|
@ -0,0 +1,478 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Project: wp-Typography
|
||||
Project URI: https://code.mundschenk.at/wp-typography/
|
||||
|
||||
File modified to place pattern and exceptions in arrays that can be understood in php files.
|
||||
This file is released under the same copyright as the below referenced original file
|
||||
Original unmodified file is available at: http://ctan.mirrorcatalogs.com/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/
|
||||
Original file name: hyph-la.tex
|
||||
|
||||
//============================================================================================================
|
||||
ORIGINAL FILE INFO
|
||||
|
||||
%
|
||||
% ********** hyph-la.tex *************
|
||||
%
|
||||
% Copyright 1999-2014 Claudio Beccari
|
||||
% [latin hyphenation patterns]
|
||||
%
|
||||
% -----------------------------------------------------------------
|
||||
% IMPORTANT NOTICE:
|
||||
%
|
||||
% This program can be redistributed and/or modified under the terms
|
||||
% of the LaTeX Project Public License Distributed from CTAN
|
||||
% archives in directory macros/latex/base/lppl.txt; either
|
||||
% version 1 of the License, or any later version.
|
||||
% -----------------------------------------------------------------
|
||||
%
|
||||
% Patterns for the latin language mainly in modern spelling
|
||||
% (u when u is needed and v when v is needed); medieval spelling
|
||||
% with the ligatures \ae and \oe and the (uncial) lowercase `v'
|
||||
% written as a `u' is also supported; apparently there is no conflict
|
||||
% between the patterns of modern Latin and those of medieval Latin.
|
||||
%
|
||||
%
|
||||
% Prepared by Claudio Beccari
|
||||
% Politecnico di Torino
|
||||
% Torino, Italy
|
||||
% e-mail claudio dot beccari at gmail.com
|
||||
%
|
||||
% \versionnumber{3.2a} \versiondate{2014/06/04}
|
||||
%
|
||||
% For more information please read the babel-latin documentation.
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
% For documentation see:
|
||||
% C. Beccari, "Computer aided hyphenation for Italian and Modern
|
||||
% Latin", TUG vol. 13, n. 1, pp. 23-33 (1992)
|
||||
%
|
||||
% see also
|
||||
%
|
||||
% C. Beccari, "Typesetting of ancient languages",
|
||||
% TUG vol.15, n.1, pp. 9-16 (1994)
|
||||
%
|
||||
% In the former paper the code was described as being contained in file
|
||||
% ITALAT.TEX; this is substantially the same code, but the file has been
|
||||
% renamed and included in hyph-utf8.
|
||||
%
|
||||
% A corresponding file (ITHYPH.TEX) has been extracted in order to eliminate
|
||||
% the (few) patterns specific to Latin and leave those specific to Italian;
|
||||
% ITHYPH.TEX has been further extended with many new patterns in order to
|
||||
% cope with the many neologisms and technical terms with foreign roots.
|
||||
%
|
||||
% Should you find any word that gets hyphenated in a wrong way, please, AFTER
|
||||
% CHECKING ON A RELIABLE MODERN DICTIONARY, report to the author, preferably
|
||||
% by e-mail. Please do not report about wrong break points concerning
|
||||
% prefixes and/or suffixes; see at the bottom of this file.
|
||||
%
|
||||
% Compared with the previous versions, this file has been extended so as to
|
||||
% cope also with the medieval Latin spelling, where the letter `V' played the
|
||||
% roles of both `U' and `V', as in the Roman times, save that the Romans used
|
||||
% only capitals. In the middle ages the availability of soft writing supports
|
||||
% and the necessity of copying books with a reasonable speed, several scripts
|
||||
% evolved in (practically) all of which there was a lower case alphabet
|
||||
% different from the upper case one, and where the lower case `v' had the
|
||||
% rounded shape of our modern lower case `u', and where the Latin diphthongs
|
||||
% `AE' and `OE', both in upper and lower case, where written as ligatures,
|
||||
% not to mention the habit of substituting them with their sound, that is a
|
||||
% simple `E'.
|
||||
%
|
||||
% According to Leon Battista Alberti, who in 1466 wrote a book on
|
||||
% cryptography where he thoroughly analyzed the hyphenation of the Latin
|
||||
% language of his (still medieval) times, the differences from the Tuscan
|
||||
% language (the Italian language, as it was named at his time) were very
|
||||
% limited, in particular for what concerns the handling of the ascending and
|
||||
% descending diphthongs; in Central and Northern Europe, and later on in
|
||||
% North America, the Scholars perceived the above diphthongs as made of two
|
||||
% distinct vowels; the hyphenation of medieval Latin, therefore, was quite
|
||||
% different in the northern countries compared to the southern ones, at least
|
||||
% for what concerns these diphthongs. If you need hyphenation patterns for
|
||||
% medieval Latin that suite you better according to the habits of Northern
|
||||
% Europe you should resort to the hyphenation patterns prepared by Yannis
|
||||
% Haralambous (TUGboat, vol.13 n.4 (1992)).
|
||||
%
|
||||
%
|
||||
%
|
||||
% PREFIXES AND SUFFIXES
|
||||
%
|
||||
% For what concerns prefixes and suffixes, the latter are generally separated
|
||||
% according to "natural" syllabification, while the former are generally
|
||||
% divided etimologically. In order to avoid an excessive number of patterns,
|
||||
% care has been paid to some prefixes, especially "ex", "trans", "circum",
|
||||
% "prae", but this set of patterns is NOT capable of separating the prefixes
|
||||
% in all circumstances.
|
||||
%
|
||||
% BABEL SHORTCUTS AND FACILITIES
|
||||
%
|
||||
% Read the documentation coming with the discription of the Latin language
|
||||
% interface of Babel in order to see the shortcuts and the facilities
|
||||
% introduced in order to facilitate the insertion of "compound word marks"
|
||||
% which are very useful for inserting etimological break points.
|
||||
%
|
||||
% Happy Latin and multilingual typesetting!
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
% \message{Latin Hyphenation Patterns Version 3.2a <2014/06/04>}
|
||||
%
|
||||
|
||||
|
||||
//============================================================================================================
|
||||
|
||||
*/
|
||||
|
||||
$patgenLanguage = 'Latin';
|
||||
|
||||
$patgenExceptions = array();
|
||||
|
||||
$patgenMaxSeg = 7;
|
||||
|
||||
$patgen = array(
|
||||
'begin' => array(
|
||||
'abl' => '0230',
|
||||
'anti' => '00001',
|
||||
'antimn' => '0000320',
|
||||
'circum' => '0000021',
|
||||
'coniun' => '0021000',
|
||||
'discine' => '00230000',
|
||||
'ex' => '021',
|
||||
'ob' => '023',
|
||||
'parai' => '000010',
|
||||
'parau' => '000010',
|
||||
'sublu' => '002300',
|
||||
'subr' => '00230',
|
||||
),
|
||||
|
||||
'end' => array(
|
||||
'sque' => '23000',
|
||||
'sdem' => '23000',
|
||||
'b' => '20',
|
||||
'c' => '20',
|
||||
'd' => '20',
|
||||
'f' => '20',
|
||||
'g' => '20',
|
||||
'h' => '20',
|
||||
'l' => '20',
|
||||
'm' => '20',
|
||||
'n' => '20',
|
||||
'p' => '20',
|
||||
'r' => '20',
|
||||
's' => '20',
|
||||
'st' => '200',
|
||||
't' => '20',
|
||||
'x' => '20',
|
||||
'z' => '20',
|
||||
),
|
||||
|
||||
'all' => array(
|
||||
'psic' => '32000',
|
||||
'pneu' => '32000',
|
||||
'æ' => '01',
|
||||
'œ' => '01',
|
||||
'aia' => '0100',
|
||||
'aie' => '0100',
|
||||
'aio' => '0100',
|
||||
'aiu' => '0100',
|
||||
'aea' => '0010',
|
||||
'aeo' => '0010',
|
||||
'aeu' => '0010',
|
||||
'eiu' => '0100',
|
||||
'ioi' => '0010',
|
||||
'oia' => '0100',
|
||||
'oie' => '0100',
|
||||
'oio' => '0100',
|
||||
'oiu' => '0100',
|
||||
'uou' => '0030',
|
||||
'b' => '10',
|
||||
'bb' => '200',
|
||||
'bd' => '200',
|
||||
'bl' => '020',
|
||||
'bm' => '200',
|
||||
'bn' => '200',
|
||||
'br' => '020',
|
||||
'bt' => '200',
|
||||
'bs' => '200',
|
||||
'c' => '10',
|
||||
'cc' => '200',
|
||||
'ch' => '022',
|
||||
'cl' => '020',
|
||||
'cm' => '200',
|
||||
'cn' => '200',
|
||||
'cq' => '200',
|
||||
'cr' => '020',
|
||||
'cs' => '200',
|
||||
'ct' => '200',
|
||||
'cz' => '200',
|
||||
'd' => '10',
|
||||
'dd' => '200',
|
||||
'dg' => '200',
|
||||
'dm' => '200',
|
||||
'dr' => '020',
|
||||
'ds' => '200',
|
||||
'dv' => '200',
|
||||
'f' => '10',
|
||||
'ff' => '200',
|
||||
'fl' => '020',
|
||||
'fn' => '200',
|
||||
'fr' => '020',
|
||||
'ft' => '200',
|
||||
'g' => '10',
|
||||
'gg' => '200',
|
||||
'gd' => '200',
|
||||
'gf' => '200',
|
||||
'gl' => '020',
|
||||
'gm' => '200',
|
||||
'gn' => '020',
|
||||
'gr' => '020',
|
||||
'gs' => '200',
|
||||
'gv' => '200',
|
||||
'h' => '10',
|
||||
'hp' => '200',
|
||||
'ht' => '200',
|
||||
'j' => '10',
|
||||
'k' => '10',
|
||||
'kk' => '200',
|
||||
'kh' => '022',
|
||||
'l' => '10',
|
||||
'lb' => '200',
|
||||
'lc' => '200',
|
||||
'ld' => '200',
|
||||
'lf' => '200',
|
||||
'lft' => '0320',
|
||||
'lg' => '200',
|
||||
'lk' => '200',
|
||||
'll' => '200',
|
||||
'lm' => '200',
|
||||
'ln' => '200',
|
||||
'lp' => '200',
|
||||
'lq' => '200',
|
||||
'lr' => '200',
|
||||
'ls' => '200',
|
||||
'lt' => '200',
|
||||
'lv' => '200',
|
||||
'm' => '10',
|
||||
'mm' => '200',
|
||||
'mb' => '200',
|
||||
'mp' => '200',
|
||||
'ml' => '200',
|
||||
'mn' => '200',
|
||||
'mq' => '200',
|
||||
'mr' => '200',
|
||||
'mv' => '200',
|
||||
'n' => '10',
|
||||
'nb' => '200',
|
||||
'nc' => '200',
|
||||
'nd' => '200',
|
||||
'nf' => '200',
|
||||
'ng' => '200',
|
||||
'nl' => '200',
|
||||
'nm' => '200',
|
||||
'nn' => '200',
|
||||
'np' => '200',
|
||||
'nq' => '200',
|
||||
'nr' => '200',
|
||||
'ns' => '200',
|
||||
'nsm' => '0230',
|
||||
'nsf' => '0230',
|
||||
'nt' => '200',
|
||||
'nv' => '200',
|
||||
'nx' => '200',
|
||||
'p' => '10',
|
||||
'ph' => '020',
|
||||
'pl' => '020',
|
||||
'pn' => '200',
|
||||
'pp' => '200',
|
||||
'pr' => '020',
|
||||
'ps' => '200',
|
||||
'pt' => '200',
|
||||
'pz' => '200',
|
||||
'php' => '2000',
|
||||
'pht' => '2000',
|
||||
'qu' => '102',
|
||||
'r' => '10',
|
||||
'rb' => '200',
|
||||
'rc' => '200',
|
||||
'rd' => '200',
|
||||
'rf' => '200',
|
||||
'rg' => '200',
|
||||
'rh' => '020',
|
||||
'rl' => '200',
|
||||
'rm' => '200',
|
||||
'rn' => '200',
|
||||
'rp' => '200',
|
||||
'rq' => '200',
|
||||
'rr' => '200',
|
||||
'rs' => '200',
|
||||
'rt' => '200',
|
||||
'rv' => '200',
|
||||
'rz' => '200',
|
||||
's' => '12',
|
||||
'sph' => '2300',
|
||||
'ss' => '230',
|
||||
'stb' => '2000',
|
||||
'stc' => '2000',
|
||||
'std' => '2000',
|
||||
'stf' => '2000',
|
||||
'stg' => '2000',
|
||||
'stl' => '2030',
|
||||
'stm' => '2000',
|
||||
'stn' => '2000',
|
||||
'stp' => '2000',
|
||||
'stq' => '2000',
|
||||
'sts' => '2000',
|
||||
'stt' => '2000',
|
||||
'stv' => '2000',
|
||||
't' => '10',
|
||||
'tb' => '200',
|
||||
'tc' => '200',
|
||||
'td' => '200',
|
||||
'tf' => '200',
|
||||
'tg' => '200',
|
||||
'th' => '020',
|
||||
'tl' => '020',
|
||||
'tr' => '020',
|
||||
'tm' => '200',
|
||||
'tn' => '200',
|
||||
'tp' => '200',
|
||||
'tq' => '200',
|
||||
'tt' => '200',
|
||||
'tv' => '200',
|
||||
'v' => '10',
|
||||
'vl' => '020',
|
||||
'vr' => '020',
|
||||
'vv' => '200',
|
||||
'x' => '10',
|
||||
'xt' => '200',
|
||||
'xx' => '200',
|
||||
'z' => '10',
|
||||
'aua' => '0100',
|
||||
'aue' => '0100',
|
||||
'aui' => '0100',
|
||||
'auo' => '0100',
|
||||
'auu' => '0100',
|
||||
'eua' => '0100',
|
||||
'eue' => '0100',
|
||||
'eui' => '0100',
|
||||
'euo' => '0100',
|
||||
'euu' => '0100',
|
||||
'iua' => '0100',
|
||||
'iue' => '0100',
|
||||
'iui' => '0100',
|
||||
'iuo' => '0100',
|
||||
'iuu' => '0100',
|
||||
'oua' => '0100',
|
||||
'oue' => '0100',
|
||||
'oui' => '0100',
|
||||
'ouo' => '0100',
|
||||
'ouu' => '0100',
|
||||
'uua' => '0100',
|
||||
'uue' => '0100',
|
||||
'uui' => '0100',
|
||||
'uuo' => '0100',
|
||||
'uuu' => '0100',
|
||||
'alua' => '02100',
|
||||
'alue' => '02100',
|
||||
'alui' => '02100',
|
||||
'aluo' => '02100',
|
||||
'aluu' => '02100',
|
||||
'elua' => '02100',
|
||||
'elue' => '02100',
|
||||
'elui' => '02100',
|
||||
'eluo' => '02100',
|
||||
'eluu' => '02100',
|
||||
'ilua' => '02100',
|
||||
'ilue' => '02100',
|
||||
'ilui' => '02100',
|
||||
'iluo' => '02100',
|
||||
'iluu' => '02100',
|
||||
'olua' => '02100',
|
||||
'olue' => '02100',
|
||||
'olui' => '02100',
|
||||
'oluo' => '02100',
|
||||
'oluu' => '02100',
|
||||
'ulua' => '02100',
|
||||
'ulue' => '02100',
|
||||
'ului' => '02100',
|
||||
'uluo' => '02100',
|
||||
'uluu' => '02100',
|
||||
'amua' => '02100',
|
||||
'amue' => '02100',
|
||||
'amui' => '02100',
|
||||
'amuo' => '02100',
|
||||
'amuu' => '02100',
|
||||
'emua' => '02100',
|
||||
'emue' => '02100',
|
||||
'emui' => '02100',
|
||||
'emuo' => '02100',
|
||||
'emuu' => '02100',
|
||||
'imua' => '02100',
|
||||
'imue' => '02100',
|
||||
'imui' => '02100',
|
||||
'imuo' => '02100',
|
||||
'imuu' => '02100',
|
||||
'omua' => '02100',
|
||||
'omue' => '02100',
|
||||
'omui' => '02100',
|
||||
'omuo' => '02100',
|
||||
'omuu' => '02100',
|
||||
'umua' => '02100',
|
||||
'umue' => '02100',
|
||||
'umui' => '02100',
|
||||
'umuo' => '02100',
|
||||
'umuu' => '02100',
|
||||
'anua' => '02100',
|
||||
'anue' => '02100',
|
||||
'anui' => '02100',
|
||||
'anuo' => '02100',
|
||||
'anuu' => '02100',
|
||||
'enua' => '02100',
|
||||
'enue' => '02100',
|
||||
'enui' => '02100',
|
||||
'enuo' => '02100',
|
||||
'enuu' => '02100',
|
||||
'inua' => '02100',
|
||||
'inue' => '02100',
|
||||
'inui' => '02100',
|
||||
'inuo' => '02100',
|
||||
'inuu' => '02100',
|
||||
'onua' => '02100',
|
||||
'onue' => '02100',
|
||||
'onui' => '02100',
|
||||
'onuo' => '02100',
|
||||
'onuu' => '02100',
|
||||
'unua' => '02100',
|
||||
'unue' => '02100',
|
||||
'unui' => '02100',
|
||||
'unuo' => '02100',
|
||||
'unuu' => '02100',
|
||||
'arua' => '02100',
|
||||
'arue' => '02100',
|
||||
'arui' => '02100',
|
||||
'aruo' => '02100',
|
||||
'aruu' => '02100',
|
||||
'erua' => '02100',
|
||||
'erue' => '02100',
|
||||
'erui' => '02100',
|
||||
'eruo' => '02100',
|
||||
'eruu' => '02100',
|
||||
'irua' => '02100',
|
||||
'irue' => '02100',
|
||||
'irui' => '02100',
|
||||
'iruo' => '02100',
|
||||
'iruu' => '02100',
|
||||
'orua' => '02100',
|
||||
'orue' => '02100',
|
||||
'orui' => '02100',
|
||||
'oruo' => '02100',
|
||||
'oruu' => '02100',
|
||||
'urua' => '02100',
|
||||
'urue' => '02100',
|
||||
'urui' => '02100',
|
||||
'uruo' => '02100',
|
||||
'uruu' => '02100',
|
||||
),
|
||||
);
|
||||
|
||||
1628
site/OFF_plugins/typography/php-typography/lang/lt.php
Normal file
1628
site/OFF_plugins/typography/php-typography/lang/lt.php
Normal file
File diff suppressed because it is too large
Load diff
11628
site/OFF_plugins/typography/php-typography/lang/lv.php
Normal file
11628
site/OFF_plugins/typography/php-typography/lang/lv.php
Normal file
File diff suppressed because it is too large
Load diff
1108
site/OFF_plugins/typography/php-typography/lang/mn-Cyrl.php
Normal file
1108
site/OFF_plugins/typography/php-typography/lang/mn-Cyrl.php
Normal file
File diff suppressed because it is too large
Load diff
12965
site/OFF_plugins/typography/php-typography/lang/nl.php
Normal file
12965
site/OFF_plugins/typography/php-typography/lang/nl.php
Normal file
File diff suppressed because it is too large
Load diff
27615
site/OFF_plugins/typography/php-typography/lang/no.php
Normal file
27615
site/OFF_plugins/typography/php-typography/lang/no.php
Normal file
File diff suppressed because it is too large
Load diff
4195
site/OFF_plugins/typography/php-typography/lang/pl.php
Normal file
4195
site/OFF_plugins/typography/php-typography/lang/pl.php
Normal file
File diff suppressed because it is too large
Load diff
429
site/OFF_plugins/typography/php-typography/lang/pt.php
Normal file
429
site/OFF_plugins/typography/php-typography/lang/pt.php
Normal file
|
|
@ -0,0 +1,429 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Project: wp-Typography
|
||||
Project URI: https://code.mundschenk.at/wp-typography/
|
||||
|
||||
File modified to place pattern and exceptions in arrays that can be understood in php files.
|
||||
This file is released under the same copyright as the below referenced original file
|
||||
Original unmodified file is available at: http://ctan.mirrorcatalogs.com/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/
|
||||
Original file name: hyph-pt.tex
|
||||
|
||||
//============================================================================================================
|
||||
ORIGINAL FILE INFO
|
||||
|
||||
% This file is part of hyph-utf8 package and resulted from
|
||||
% semi-manual conversions of hyphenation patterns into UTF-8 in June 2008.
|
||||
%
|
||||
% Source: pthyph.tex (1994-10-13 - date on CTAN) or (1996-07-21 - date in file) - no idea
|
||||
% Author: Pedro J. de Rezende <rezende at dcc.unicamp.br>, J.Joao Dias Almeida <jj at di.uminho.pt>
|
||||
%
|
||||
% The above mentioned file should become obsolete,
|
||||
% and the author of the original file should preferably modify this file instead.
|
||||
%
|
||||
% Modifications were needed in order to support native UTF-8 engines,
|
||||
% but functionality (hopefully) didn't change in any way, at least not intentionally.
|
||||
% This file is no longer stand-alone; at least for 8-bit engines
|
||||
% you probably want to use loadhyph-foo.tex (which will load this file) instead.
|
||||
%
|
||||
% Modifications were done by Jonathan Kew, Mojca Miklavec & Arthur Reutenauer
|
||||
% with help & support from:
|
||||
% - Karl Berry, who gave us free hands and all resources
|
||||
% - Taco Hoekwater, with useful macros
|
||||
% - Hans Hagen, who did the unicodification of patterns already long before
|
||||
% and helped with testing, suggestions and bug reports
|
||||
% - Norbert Preining, who tested & integrated patterns into TeX Live
|
||||
%
|
||||
% However, the "copyright/copyleft" owner of patterns remains the original author.
|
||||
%
|
||||
% The copyright statement of this file is thus:
|
||||
%
|
||||
% Do with this file whatever needs to be done in future for the sake of
|
||||
% "a better world" as long as you respect the copyright of original file.
|
||||
% If you're the original author of patterns or taking over a new revolution,
|
||||
% plese remove all of the TUG comments & credits that we added here -
|
||||
% you are the Queen / the King, we are only the servants.
|
||||
%
|
||||
% If you want to change this file, rather than uploading directly to CTAN,
|
||||
% we would be grateful if you could send it to us (http://tug.org/tex-hyphen)
|
||||
% or ask for credentials for SVN repository and commit it yourself;
|
||||
% we will then upload the whole "package" to CTAN.
|
||||
%
|
||||
% Before a new "pattern-revolution" starts,
|
||||
% please try to follow some guidelines if possible:
|
||||
%
|
||||
% - \lccode is *forbidden*, and I really mean it
|
||||
% - all the patterns should be in UTF-8
|
||||
% - the only "allowed" TeX commands in this file are: \patterns, \hyphenation,
|
||||
% and if you really cannot do without, also \input and \message
|
||||
% - in particular, please no \catcode or \lccode changes,
|
||||
% they belong to loadhyph-foo.tex,
|
||||
% and no \lefthyphenmin and \righthyphenmin,
|
||||
% they have no influence here and belong elsewhere
|
||||
% - \begingroup and/or \endinput is not needed
|
||||
% - feel free to do whatever you want inside comments
|
||||
%
|
||||
% We know that TeX is extremely powerful, but give a stupid parser
|
||||
% at least a chance to read your patterns.
|
||||
%
|
||||
% For more unformation see
|
||||
%
|
||||
% http://tug.org/tex-hyphen
|
||||
%
|
||||
%------------------------------------------------------------------------------
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% The Portuguese TeX hyphenation table.
|
||||
% (C) 1996 by Pedro J. de Rezende (rezende@dcc.unicamp.br)
|
||||
% and J.Joao Dias Almeida (jj@di.uminho.pt)
|
||||
% Version: 1.2 Release date: 21/07/96
|
||||
%
|
||||
% (C) 1994 by Pedro J. de Rezende (rezende@dcc.unicamp.br)
|
||||
% Version: 1.1 Release date: 04/12/94
|
||||
%
|
||||
% (C) 1987 by Pedro J. de Rezende
|
||||
% Version: 1.0 Release date: 02/13/87
|
||||
%
|
||||
% -----------------------------------------------------------------
|
||||
% IMPORTANT NOTICE:
|
||||
%
|
||||
% This program can be redistributed and/or modified under the terms
|
||||
% of the LaTeX Project Public License Distributed from CTAN
|
||||
% archives in directory macros/latex/base/lppl.txt; either
|
||||
% version 1 of the License, or any later version.
|
||||
% -----------------------------------------------------------------
|
||||
% Remember! If you *must* change it, then call the resulting file
|
||||
% something else and attach your name to your *documented* changes.
|
||||
% ======================================================================
|
||||
%
|
||||
|
||||
|
||||
//============================================================================================================
|
||||
|
||||
*/
|
||||
|
||||
$patgenLanguage = 'Portuguese';
|
||||
|
||||
$patgenExceptions = array(
|
||||
'hardware' => 'hard-ware',
|
||||
'software' => 'soft-ware',
|
||||
);
|
||||
|
||||
$patgenMaxSeg = 3;
|
||||
|
||||
$patgen = array(
|
||||
'begin' => array( ),
|
||||
|
||||
'end' => array( ),
|
||||
|
||||
'all' => array(
|
||||
'bl' => '120',
|
||||
'br' => '120',
|
||||
'ba' => '100',
|
||||
'be' => '100',
|
||||
'bi' => '100',
|
||||
'bo' => '100',
|
||||
'bu' => '100',
|
||||
'bá' => '100',
|
||||
'bâ' => '100',
|
||||
'bã' => '100',
|
||||
'bé' => '100',
|
||||
'bí' => '100',
|
||||
'bó' => '100',
|
||||
'bú' => '100',
|
||||
'bê' => '100',
|
||||
'bõ' => '100',
|
||||
'ch' => '120',
|
||||
'cl' => '120',
|
||||
'cr' => '120',
|
||||
'ca' => '100',
|
||||
'ce' => '100',
|
||||
'ci' => '100',
|
||||
'co' => '100',
|
||||
'cu' => '100',
|
||||
'cá' => '100',
|
||||
'câ' => '100',
|
||||
'cã' => '100',
|
||||
'cé' => '100',
|
||||
'cí' => '100',
|
||||
'có' => '100',
|
||||
'cú' => '100',
|
||||
'cê' => '100',
|
||||
'cõ' => '100',
|
||||
'ça' => '100',
|
||||
'çe' => '100',
|
||||
'çi' => '100',
|
||||
'ço' => '100',
|
||||
'çu' => '100',
|
||||
'çá' => '100',
|
||||
'çâ' => '100',
|
||||
'çã' => '100',
|
||||
'çé' => '100',
|
||||
'çí' => '100',
|
||||
'çó' => '100',
|
||||
'çú' => '100',
|
||||
'çê' => '100',
|
||||
'çõ' => '100',
|
||||
'dl' => '120',
|
||||
'dr' => '120',
|
||||
'da' => '100',
|
||||
'de' => '100',
|
||||
'di' => '100',
|
||||
'do' => '100',
|
||||
'du' => '100',
|
||||
'dá' => '100',
|
||||
'dâ' => '100',
|
||||
'dã' => '100',
|
||||
'dé' => '100',
|
||||
'dí' => '100',
|
||||
'dó' => '100',
|
||||
'dú' => '100',
|
||||
'dê' => '100',
|
||||
'dõ' => '100',
|
||||
'fl' => '120',
|
||||
'fr' => '120',
|
||||
'fa' => '100',
|
||||
'fe' => '100',
|
||||
'fi' => '100',
|
||||
'fo' => '100',
|
||||
'fu' => '100',
|
||||
'fá' => '100',
|
||||
'fâ' => '100',
|
||||
'fã' => '100',
|
||||
'fé' => '100',
|
||||
'fí' => '100',
|
||||
'fó' => '100',
|
||||
'fú' => '100',
|
||||
'fê' => '100',
|
||||
'fõ' => '100',
|
||||
'gl' => '120',
|
||||
'gr' => '120',
|
||||
'ga' => '100',
|
||||
'ge' => '100',
|
||||
'gi' => '100',
|
||||
'go' => '100',
|
||||
'gu' => '100',
|
||||
'gua' => '1040',
|
||||
'gue' => '1040',
|
||||
'gui' => '1040',
|
||||
'guo' => '1040',
|
||||
'gá' => '100',
|
||||
'gâ' => '100',
|
||||
'gã' => '100',
|
||||
'gé' => '100',
|
||||
'gí' => '100',
|
||||
'gó' => '100',
|
||||
'gú' => '100',
|
||||
'gê' => '100',
|
||||
'gõ' => '100',
|
||||
'ja' => '100',
|
||||
'je' => '100',
|
||||
'ji' => '100',
|
||||
'jo' => '100',
|
||||
'ju' => '100',
|
||||
'já' => '100',
|
||||
'jâ' => '100',
|
||||
'jã' => '100',
|
||||
'jé' => '100',
|
||||
'jí' => '100',
|
||||
'jó' => '100',
|
||||
'jú' => '100',
|
||||
'jê' => '100',
|
||||
'jõ' => '100',
|
||||
'kl' => '120',
|
||||
'kr' => '120',
|
||||
'ka' => '100',
|
||||
'ke' => '100',
|
||||
'ki' => '100',
|
||||
'ko' => '100',
|
||||
'ku' => '100',
|
||||
'ká' => '100',
|
||||
'kâ' => '100',
|
||||
'kã' => '100',
|
||||
'ké' => '100',
|
||||
'kí' => '100',
|
||||
'kó' => '100',
|
||||
'kú' => '100',
|
||||
'kê' => '100',
|
||||
'kõ' => '100',
|
||||
'lh' => '120',
|
||||
'la' => '100',
|
||||
'le' => '100',
|
||||
'li' => '100',
|
||||
'lo' => '100',
|
||||
'lu' => '100',
|
||||
'lá' => '100',
|
||||
'lâ' => '100',
|
||||
'lã' => '100',
|
||||
'lé' => '100',
|
||||
'lí' => '100',
|
||||
'ló' => '100',
|
||||
'lú' => '100',
|
||||
'lê' => '100',
|
||||
'lõ' => '100',
|
||||
'ma' => '100',
|
||||
'me' => '100',
|
||||
'mi' => '100',
|
||||
'mo' => '100',
|
||||
'mu' => '100',
|
||||
'má' => '100',
|
||||
'mâ' => '100',
|
||||
'mã' => '100',
|
||||
'mé' => '100',
|
||||
'mí' => '100',
|
||||
'mó' => '100',
|
||||
'mú' => '100',
|
||||
'mê' => '100',
|
||||
'mõ' => '100',
|
||||
'nh' => '120',
|
||||
'na' => '100',
|
||||
'ne' => '100',
|
||||
'ni' => '100',
|
||||
'no' => '100',
|
||||
'nu' => '100',
|
||||
'ná' => '100',
|
||||
'nâ' => '100',
|
||||
'nã' => '100',
|
||||
'né' => '100',
|
||||
'ní' => '100',
|
||||
'nó' => '100',
|
||||
'nú' => '100',
|
||||
'nê' => '100',
|
||||
'nõ' => '100',
|
||||
'pl' => '120',
|
||||
'pr' => '120',
|
||||
'pa' => '100',
|
||||
'pe' => '100',
|
||||
'pi' => '100',
|
||||
'po' => '100',
|
||||
'pu' => '100',
|
||||
'pá' => '100',
|
||||
'pâ' => '100',
|
||||
'pã' => '100',
|
||||
'pé' => '100',
|
||||
'pí' => '100',
|
||||
'pó' => '100',
|
||||
'pú' => '100',
|
||||
'pê' => '100',
|
||||
'põ' => '100',
|
||||
'qua' => '1040',
|
||||
'que' => '1040',
|
||||
'qui' => '1040',
|
||||
'quo' => '1040',
|
||||
'ra' => '100',
|
||||
're' => '100',
|
||||
'ri' => '100',
|
||||
'ro' => '100',
|
||||
'ru' => '100',
|
||||
'rá' => '100',
|
||||
'râ' => '100',
|
||||
'rã' => '100',
|
||||
'ré' => '100',
|
||||
'rí' => '100',
|
||||
'ró' => '100',
|
||||
'rú' => '100',
|
||||
'rê' => '100',
|
||||
'rõ' => '100',
|
||||
'sa' => '100',
|
||||
'se' => '100',
|
||||
'si' => '100',
|
||||
'so' => '100',
|
||||
'su' => '100',
|
||||
'sá' => '100',
|
||||
'sâ' => '100',
|
||||
'sã' => '100',
|
||||
'sé' => '100',
|
||||
'sí' => '100',
|
||||
'só' => '100',
|
||||
'sú' => '100',
|
||||
'sê' => '100',
|
||||
'sõ' => '100',
|
||||
'tl' => '120',
|
||||
'tr' => '120',
|
||||
'ta' => '100',
|
||||
'te' => '100',
|
||||
'ti' => '100',
|
||||
'to' => '100',
|
||||
'tu' => '100',
|
||||
'tá' => '100',
|
||||
'tâ' => '100',
|
||||
'tã' => '100',
|
||||
'té' => '100',
|
||||
'tí' => '100',
|
||||
'tó' => '100',
|
||||
'tú' => '100',
|
||||
'tê' => '100',
|
||||
'tõ' => '100',
|
||||
'vl' => '120',
|
||||
'vr' => '120',
|
||||
'va' => '100',
|
||||
've' => '100',
|
||||
'vi' => '100',
|
||||
'vo' => '100',
|
||||
'vu' => '100',
|
||||
'vá' => '100',
|
||||
'vâ' => '100',
|
||||
'vã' => '100',
|
||||
'vé' => '100',
|
||||
'ví' => '100',
|
||||
'vó' => '100',
|
||||
'vú' => '100',
|
||||
'vê' => '100',
|
||||
'võ' => '100',
|
||||
'wl' => '120',
|
||||
'wr' => '120',
|
||||
'xa' => '100',
|
||||
'xe' => '100',
|
||||
'xi' => '100',
|
||||
'xo' => '100',
|
||||
'xu' => '100',
|
||||
'xá' => '100',
|
||||
'xâ' => '100',
|
||||
'xã' => '100',
|
||||
'xé' => '100',
|
||||
'xí' => '100',
|
||||
'xó' => '100',
|
||||
'xú' => '100',
|
||||
'xê' => '100',
|
||||
'xõ' => '100',
|
||||
'za' => '100',
|
||||
'ze' => '100',
|
||||
'zi' => '100',
|
||||
'zo' => '100',
|
||||
'zu' => '100',
|
||||
'zá' => '100',
|
||||
'zâ' => '100',
|
||||
'zã' => '100',
|
||||
'zé' => '100',
|
||||
'zí' => '100',
|
||||
'zó' => '100',
|
||||
'zú' => '100',
|
||||
'zê' => '100',
|
||||
'zõ' => '100',
|
||||
'aa' => '030',
|
||||
'ae' => '030',
|
||||
'ao' => '030',
|
||||
'cc' => '030',
|
||||
'ea' => '030',
|
||||
'ee' => '030',
|
||||
'eo' => '030',
|
||||
'ia' => '030',
|
||||
'ie' => '030',
|
||||
'ii' => '030',
|
||||
'io' => '030',
|
||||
'iâ' => '030',
|
||||
'iê' => '030',
|
||||
'iô' => '030',
|
||||
'oa' => '030',
|
||||
'oe' => '030',
|
||||
'oo' => '030',
|
||||
'rr' => '030',
|
||||
'ss' => '030',
|
||||
'ua' => '030',
|
||||
'ue' => '030',
|
||||
'uo' => '030',
|
||||
'uu' => '030',
|
||||
'-' => '10',
|
||||
),
|
||||
);
|
||||
|
||||
790
site/OFF_plugins/typography/php-typography/lang/ro.php
Normal file
790
site/OFF_plugins/typography/php-typography/lang/ro.php
Normal file
|
|
@ -0,0 +1,790 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Project: wp-Typography
|
||||
Project URI: https://code.mundschenk.at/wp-typography/
|
||||
|
||||
File modified to place pattern and exceptions in arrays that can be understood in php files.
|
||||
This file is released under the same copyright as the below referenced original file
|
||||
Original unmodified file is available at: http://ctan.mirrorcatalogs.com/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/
|
||||
Original file name: hyph-ro.tex
|
||||
|
||||
//============================================================================================================
|
||||
ORIGINAL FILE INFO
|
||||
|
||||
% This file is part of hyph-utf8 package and resulted from
|
||||
% semi-manual conversions of hyphenation patterns into UTF-8 in June 2008.
|
||||
%
|
||||
% Source: rohyphen.tex (1996-11-11)
|
||||
% Author: Adrian Rezus <adriaan at {sci,cs}.kun.nl>
|
||||
%
|
||||
% The above mentioned file should become obsolete,
|
||||
% and the author of the original file should preferably modify this file instead.
|
||||
%
|
||||
% Modifications were needed in order to support native UTF-8 engines,
|
||||
% but functionality (hopefully) didn't change in any way, at least not intentionally.
|
||||
% This file is no longer stand-alone; at least for 8-bit engines
|
||||
% you probably want to use loadhyph-foo.tex (which will load this file) instead.
|
||||
%
|
||||
% Modifications were done by Jonathan Kew, Mojca Miklavec & Arthur Reutenauer
|
||||
% with help & support from:
|
||||
% - Karl Berry, who gave us free hands and all resources
|
||||
% - Taco Hoekwater, with useful macros
|
||||
% - Hans Hagen, who did the unicodification of patterns already long before
|
||||
% and helped with testing, suggestions and bug reports
|
||||
% - Norbert Preining, who tested & integrated patterns into TeX Live
|
||||
%
|
||||
% However, the "copyright/copyleft" owner of patterns remains the original author.
|
||||
%
|
||||
% The copyright statement of this file is thus:
|
||||
%
|
||||
% Do with this file whatever needs to be done in future for the sake of
|
||||
% "a better world" as long as you respect the copyright of original file.
|
||||
% If you're the original author of patterns or taking over a new revolution,
|
||||
% plese remove all of the TUG comments & credits that we added here -
|
||||
% you are the Queen / the King, we are only the servants.
|
||||
%
|
||||
% If you want to change this file, rather than uploading directly to CTAN,
|
||||
% we would be grateful if you could send it to us (http://tug.org/tex-hyphen)
|
||||
% or ask for credentials for SVN repository and commit it yourself;
|
||||
% we will then upload the whole "package" to CTAN.
|
||||
%
|
||||
% Before a new "pattern-revolution" starts,
|
||||
% please try to follow some guidelines if possible:
|
||||
%
|
||||
% - \lccode is *forbidden*, and I really mean it
|
||||
% - all the patterns should be in UTF-8
|
||||
% - the only "allowed" TeX commands in this file are: \patterns, \hyphenation,
|
||||
% and if you really cannot do without, also \input and \message
|
||||
% - in particular, please no \catcode or \lccode changes,
|
||||
% they belong to loadhyph-foo.tex,
|
||||
% and no \lefthyphenmin and \righthyphenmin,
|
||||
% they have no influence here and belong elsewhere
|
||||
% - \begingroup and/or \endinput is not needed
|
||||
% - feel free to do whatever you want inside comments
|
||||
%
|
||||
% We know that TeX is extremely powerful, but give a stupid parser
|
||||
% at least a chance to read your patterns.
|
||||
%
|
||||
% For more unformation see
|
||||
%
|
||||
% http://tug.org/tex-hyphen
|
||||
%
|
||||
%------------------------------------------------------------------------------
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% ROHYPHEN.TEX, version 1.1 <29.10.1996> R [7.11.1996] %%
|
||||
%% (C) 1995-1996 Adrian Rezus [adriaan@{sci,cs}.kun.nl] %%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%
|
||||
%% Romanian TeX hyphenation table: NFSS 2 encoding, medium.
|
||||
%% Contents: 647 Romanian hyphen patterns, with diacritics.
|
||||
%%
|
||||
%% This file is part of the Romanian TeX system.
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Romanian TeX, version 1.3R <29.10.1996> %%
|
||||
%% (C) 1994-1996 Adrian Rezus %%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% History:
|
||||
%% ROHYPHEN.TEX 1.0 <10.02.1995>: Plain TeX and LaTeX 2.09.
|
||||
%% ROHYPHEN.TEX 1.1 <29.10.1996>: Plain TeX and LaTeX2e.
|
||||
%
|
||||
% -------------------------------------------------------------------
|
||||
% TODO: fix the notice below - it only holds for the old patterns
|
||||
% NB This file must be used in conjunction with either one of
|
||||
%
|
||||
% (1) ROMANIAN.TEX v1.2(R) [1994-1995] [(La)TeX] or
|
||||
% (2) ROMANIAN.STY v1.3R [1996] [(La)TeX(2e)]
|
||||
%
|
||||
% NB Romanian has LR-HYPHEN-MINs [2 2] (like German)!
|
||||
% NB Romanian has STRUCTURAL HYPHEN-AMBIGUA:
|
||||
% i.e., words that canNOT be hyphenated correctly without
|
||||
% additional (e.g., semantic, stress-mark) information.
|
||||
% --------------------------------------------------------
|
||||
% The Romanian TeX encoding of the Romanian diacritics:
|
||||
% --------------------------------------------------------
|
||||
% Romanian TeX DQ-macro encodings = (La)TeX macros
|
||||
% --------------------------------------------------------
|
||||
% ă = \u{a} [-] \u{A} [not encoded]
|
||||
% â = \^{a} [-] \^{A} [not encoded]
|
||||
% î = \^{\i} "I = \^{I}
|
||||
% ș = \c{s} "S = \c{S}
|
||||
% ț = \c{t} "T = \c{T}
|
||||
% -------------------------------------------------------------
|
||||
% NB Romanian \^{a} behaves like \^{\i} as regards hyphenation.
|
||||
% NB The capital \u{A} and \^{A} are rare in script; as such,
|
||||
% they occur only in records of the Romanian substandard.
|
||||
% -------------------------------------------------------------------
|
||||
%
|
||||
% original patterns generated by PatGen2-output hyphen-level 9: do NOT modify the list by hand!
|
||||
%
|
||||
|
||||
|
||||
//============================================================================================================
|
||||
|
||||
*/
|
||||
|
||||
$patgenLanguage = 'Romanian';
|
||||
|
||||
$patgenExceptions = array();
|
||||
|
||||
$patgenMaxSeg = 7;
|
||||
|
||||
$patgen = array(
|
||||
'begin' => array(
|
||||
'aic' => '0300',
|
||||
'anis' => '04300',
|
||||
'az' => '020',
|
||||
'cre' => '0001',
|
||||
'deaj' => '00200',
|
||||
'dez' => '0021',
|
||||
'g' => '04',
|
||||
'ia' => '020',
|
||||
'ie' => '020',
|
||||
'iț' => '030',
|
||||
'iu' => '043',
|
||||
'iv' => '030',
|
||||
'îm' => '040',
|
||||
'n' => '02',
|
||||
'ni' => '002',
|
||||
'p' => '04',
|
||||
'preș' => '00030',
|
||||
's' => '04',
|
||||
'ș' => '04',
|
||||
'ui' => '040',
|
||||
'uni' => '0500',
|
||||
'z' => '02',
|
||||
),
|
||||
|
||||
'end' => array(
|
||||
'an' => '200',
|
||||
'ăti' => '0200',
|
||||
'b' => '20',
|
||||
'bia' => '0020',
|
||||
'bține' => '000400',
|
||||
'c' => '40',
|
||||
'chi' => '2000',
|
||||
'ci' => '200',
|
||||
'd' => '40',
|
||||
'f' => '20',
|
||||
'fi' => '200',
|
||||
'g' => '20',
|
||||
'ghi' => '2000',
|
||||
'gi' => '200',
|
||||
'h' => '20',
|
||||
'hi' => '200',
|
||||
'i' => '40',
|
||||
'j' => '20',
|
||||
'ji' => '200',
|
||||
'l' => '40',
|
||||
'li' => '400',
|
||||
'm' => '20',
|
||||
'mi' => '400',
|
||||
'n' => '40',
|
||||
'ni' => '400',
|
||||
'obi' => '0200',
|
||||
'omedie' => '0000020',
|
||||
'orte' => '00200',
|
||||
'p' => '20',
|
||||
'pi' => '200',
|
||||
'pie' => '0030',
|
||||
'pți' => '0400',
|
||||
'r' => '40',
|
||||
'ri' => '400',
|
||||
's' => '40',
|
||||
'sc' => '400',
|
||||
'see' => '0040',
|
||||
'ș' => '40',
|
||||
'și' => '400',
|
||||
'ști' => '4000',
|
||||
't' => '40',
|
||||
'ti' => '400',
|
||||
'tii' => '3000',
|
||||
'tî' => '200',
|
||||
'tru' => '3000',
|
||||
'ț' => '20',
|
||||
'ți' => '200',
|
||||
'ția' => '0030',
|
||||
'u' => '60',
|
||||
'ua' => '020',
|
||||
'v' => '20',
|
||||
'vi' => '200',
|
||||
'x' => '20',
|
||||
'z' => '20',
|
||||
'zi' => '200',
|
||||
),
|
||||
|
||||
'all' => array(
|
||||
'a' => '01',
|
||||
'acă' => '2000',
|
||||
'achi' => '00005',
|
||||
'ae' => '030',
|
||||
'afo' => '0003',
|
||||
'aia' => '0320',
|
||||
'aie' => '0320',
|
||||
'ail' => '0300',
|
||||
'ais' => '0032',
|
||||
'aiu' => '0300',
|
||||
'alie' => '00006',
|
||||
'alt' => '2000',
|
||||
'am' => '020',
|
||||
'an' => '020',
|
||||
'ane' => '0520',
|
||||
'anie' => '00020',
|
||||
'aniș' => '00034',
|
||||
'ans' => '0040',
|
||||
'anu' => '2000',
|
||||
'anz' => '0020',
|
||||
'aog' => '0020',
|
||||
'atia' => '00040',
|
||||
'atr' => '2000',
|
||||
'atu' => '0540',
|
||||
'ața' => '2000',
|
||||
'ață' => '2000',
|
||||
'au' => '200',
|
||||
'aua' => '0300',
|
||||
'aud' => '0300',
|
||||
'aug' => '0300',
|
||||
'aul' => '0300',
|
||||
'aun' => '0300',
|
||||
'aur' => '0300',
|
||||
'aus' => '0300',
|
||||
'aute' => '03000',
|
||||
'auț' => '0320',
|
||||
'auz' => '0300',
|
||||
'ă' => '21',
|
||||
'ăi' => '030',
|
||||
'ăie' => '0020',
|
||||
'ăm' => '022',
|
||||
'ănu' => '0003',
|
||||
'ărgi' => '00005',
|
||||
'ăș' => '030',
|
||||
'ășt' => '0430',
|
||||
'ătie' => '00040',
|
||||
'ău' => '030',
|
||||
'ăv' => '030',
|
||||
'ăzi' => '0200',
|
||||
'b' => '10',
|
||||
'baț' => '0020',
|
||||
'bănu' => '00005',
|
||||
'bc' => '200',
|
||||
'bd' => '200',
|
||||
'biat' => '00200',
|
||||
'bie' => '0020',
|
||||
'bii' => '3000',
|
||||
'bl' => '020',
|
||||
'blim' => '34000',
|
||||
'blu' => '0400',
|
||||
'bo' => '001',
|
||||
'boric' => '003000',
|
||||
'bs' => '200',
|
||||
'bt' => '200',
|
||||
'bț' => '200',
|
||||
'bu' => '003',
|
||||
'c' => '10',
|
||||
'caut' => '00300',
|
||||
'căc' => '0020',
|
||||
'cătu' => '00005',
|
||||
'cc' => '200',
|
||||
'cea' => '0020',
|
||||
'ceț' => '0020',
|
||||
'ciale' => '003000',
|
||||
'cio' => '0020',
|
||||
'cis' => '0002',
|
||||
'cisp' => '00300',
|
||||
'ciza' => '00002',
|
||||
'cl' => '040',
|
||||
'cm' => '200',
|
||||
'cn' => '250',
|
||||
'copiată' => '00000200',
|
||||
'coț' => '0020',
|
||||
'cs' => '200',
|
||||
'ct' => '200',
|
||||
'cț' => '200',
|
||||
'cuim' => '00300',
|
||||
'cul' => '3000',
|
||||
'cuț' => '0020',
|
||||
'cv' => '200',
|
||||
'd' => '10',
|
||||
'dam' => '0040',
|
||||
'daț' => '0020',
|
||||
'dc' => '200',
|
||||
'desc' => '00400',
|
||||
'dezin' => '000300',
|
||||
'dian' => '00200',
|
||||
'diată' => '000200',
|
||||
'dj' => '200',
|
||||
'dm' => '200',
|
||||
'dn' => '210',
|
||||
'doil' => '00400',
|
||||
'du' => '300',
|
||||
'eac' => '0100',
|
||||
'eaj' => '0100',
|
||||
'eal' => '0100',
|
||||
'eaș' => '0100',
|
||||
'eat' => '0100',
|
||||
'eaț' => '0020',
|
||||
'eav' => '0100',
|
||||
'ebui' => '00050',
|
||||
'ec' => '200',
|
||||
'ecia' => '00020',
|
||||
'eclare' => '0000200',
|
||||
'ediulu' => '0004000',
|
||||
'ee' => '030',
|
||||
'eea' => '0020',
|
||||
'efa' => '1000',
|
||||
'eh' => '010',
|
||||
'eia' => '0320',
|
||||
'eie' => '0320',
|
||||
'eii' => '0300',
|
||||
'eil' => '0300',
|
||||
'eim' => '0300',
|
||||
'ein' => '0300',
|
||||
'eio' => '0320',
|
||||
'eis' => '0332',
|
||||
'eit' => '0300',
|
||||
'eiu' => '0340',
|
||||
'eî' => '010',
|
||||
'el' => '200',
|
||||
'em' => '020',
|
||||
'emon' => '00005',
|
||||
'en' => '200',
|
||||
'ene' => '0500',
|
||||
'eo' => '011',
|
||||
'eon' => '0300',
|
||||
'er' => '010',
|
||||
'era' => '2000',
|
||||
'eră' => '2000',
|
||||
'erc' => '2000',
|
||||
'es' => '220',
|
||||
'esco' => '00300',
|
||||
'esti' => '00500',
|
||||
'eș' => '200',
|
||||
'eși' => '0300',
|
||||
'etanț' => '000040',
|
||||
'eț' => '200',
|
||||
'eu' => '030',
|
||||
'euș' => '0050',
|
||||
'evit' => '10000',
|
||||
'ex' => '020',
|
||||
'ez' => '200',
|
||||
'eză' => '0005',
|
||||
'ezia' => '00030',
|
||||
'ezo' => '0210',
|
||||
'f' => '14',
|
||||
'fa' => '300',
|
||||
'făș' => '3000',
|
||||
'fie' => '0030',
|
||||
'fo' => '300',
|
||||
'ft' => '200',
|
||||
'ftu' => '0500',
|
||||
'g' => '12',
|
||||
'găț' => '0030',
|
||||
'gl' => '040',
|
||||
'gm' => '230',
|
||||
'gn' => '230',
|
||||
'gon' => '0050',
|
||||
'gu' => '303',
|
||||
'gv' => '230',
|
||||
'hia' => '0020',
|
||||
'hic' => '0030',
|
||||
'hiu' => '0040',
|
||||
'hn' => '210',
|
||||
'i' => '21',
|
||||
'iac' => '3200',
|
||||
'iag' => '0034',
|
||||
'iai' => '0200',
|
||||
'iaș' => '0200',
|
||||
'iaț' => '0020',
|
||||
'ică' => '0300',
|
||||
'ied' => '0200',
|
||||
'iia' => '0300',
|
||||
'iie' => '0300',
|
||||
'iii' => '0300',
|
||||
'iil' => '0300',
|
||||
'iin' => '0300',
|
||||
'iir' => '0300',
|
||||
'iit' => '0300',
|
||||
'iitură' => '0000200',
|
||||
'iî' => '020',
|
||||
'ila' => '4000',
|
||||
'ile' => '0300',
|
||||
'ilo' => '0300',
|
||||
'imateri' => '00000006',
|
||||
'in' => '020',
|
||||
'ined' => '04100',
|
||||
'ingă' => '00200',
|
||||
'inții' => '000040',
|
||||
'inv' => '3000',
|
||||
'iod' => '0300',
|
||||
'ioni' => '03000',
|
||||
'ioț' => '0020',
|
||||
'ipă' => '0005',
|
||||
'is' => '020',
|
||||
'isf' => '0030',
|
||||
'isp' => '4000',
|
||||
'ișt' => '0030',
|
||||
'iti' => '0500',
|
||||
'iția' => '00020',
|
||||
'ițio' => '03020',
|
||||
'iua' => '0300',
|
||||
'iul' => '0300',
|
||||
'ium' => '0300',
|
||||
'iund' => '03000',
|
||||
'iunu' => '03000',
|
||||
'ius' => '0300',
|
||||
'iut' => '0300',
|
||||
'izv' => '0030',
|
||||
'î' => '02',
|
||||
'îd' => '030',
|
||||
'îe' => '030',
|
||||
'îlo' => '0300',
|
||||
'îna' => '0003',
|
||||
'înș' => '0050',
|
||||
'îri' => '0300',
|
||||
'îrî' => '0300',
|
||||
'îrș' => '0050',
|
||||
'îșt' => '0030',
|
||||
'ît' => '030',
|
||||
'îti' => '0400',
|
||||
'îț' => '030',
|
||||
'îți' => '0400',
|
||||
'îții' => '05000',
|
||||
'îz' => '030',
|
||||
'j' => '10',
|
||||
'jd' => '200',
|
||||
'jiț' => '0020',
|
||||
'jl' => '200',
|
||||
'ju' => '040',
|
||||
'jut' => '0030',
|
||||
'k' => '10',
|
||||
'l' => '10',
|
||||
'larați' => '0000002',
|
||||
'lăti' => '00200',
|
||||
'lătu' => '00005',
|
||||
'lb' => '200',
|
||||
'lc' => '200',
|
||||
'ld' => '200',
|
||||
'lea' => '0020',
|
||||
'lf' => '200',
|
||||
'lg' => '200',
|
||||
'lia' => '0030',
|
||||
'lie' => '0030',
|
||||
'lio' => '0030',
|
||||
'lm' => '200',
|
||||
'ln' => '250',
|
||||
'lp' => '200',
|
||||
'ls' => '200',
|
||||
'lș' => '230',
|
||||
'lt' => '200',
|
||||
'lț' => '200',
|
||||
'lu' => '300',
|
||||
'lv' => '200',
|
||||
'm' => '10',
|
||||
'ma' => '300',
|
||||
'mă' => '300',
|
||||
'mb' => '200',
|
||||
'mblîn' => '000003',
|
||||
'me' => '300',
|
||||
'mez' => '0020',
|
||||
'mf' => '200',
|
||||
'mi' => '300',
|
||||
'miț' => '0020',
|
||||
'mî' => '300',
|
||||
'mn' => '210',
|
||||
'mo' => '300',
|
||||
'mon' => '0004',
|
||||
'mp' => '200',
|
||||
'ms' => '232',
|
||||
'mt' => '200',
|
||||
'mț' => '200',
|
||||
'mu' => '300',
|
||||
'muț' => '0020',
|
||||
'mv' => '200',
|
||||
'na' => '300',
|
||||
'nad' => '4100',
|
||||
'nain' => '00300',
|
||||
'nă' => '300',
|
||||
'nc' => '200',
|
||||
'ncis' => '02000',
|
||||
'nciz' => '02000',
|
||||
'nd' => '200',
|
||||
'ne' => '300',
|
||||
'neab' => '00100',
|
||||
'nean' => '00100',
|
||||
'neap' => '00100',
|
||||
'nef' => '4000',
|
||||
'neg' => '4100',
|
||||
'nes' => '0032',
|
||||
'nevi' => '40000',
|
||||
'nex' => '4100',
|
||||
'ng' => '200',
|
||||
'ngăt' => '00300',
|
||||
'ni' => '300',
|
||||
'niez' => '00300',
|
||||
'nî' => '300',
|
||||
'nj' => '030',
|
||||
'nn' => '010',
|
||||
'no' => '300',
|
||||
'noș' => '0040',
|
||||
'nr' => '010',
|
||||
'ns' => '232',
|
||||
'nsf' => '0030',
|
||||
'nsî' => '0400',
|
||||
'nspo' => '00300',
|
||||
'nș' => '032',
|
||||
'nși' => '0400',
|
||||
'nt' => '200',
|
||||
'nti' => '0500',
|
||||
'ntu' => '0540',
|
||||
'nț' => '200',
|
||||
'nu' => '500',
|
||||
'nua' => '0030',
|
||||
'nuă' => '0030',
|
||||
'num' => '0050',
|
||||
'nus' => '0032',
|
||||
'nz' => '200',
|
||||
'oag' => '0100',
|
||||
'oal' => '0200',
|
||||
'oca' => '2000',
|
||||
'ocui' => '00050',
|
||||
'od' => '200',
|
||||
'odia' => '00020',
|
||||
'oe' => '030',
|
||||
'oi' => '032',
|
||||
'oiecti' => '0000002',
|
||||
'oisp' => '00320',
|
||||
'omn' => '0040',
|
||||
'on' => '200',
|
||||
'oo' => '010',
|
||||
'opie' => '00030',
|
||||
'opla' => '00002',
|
||||
'oplagi' => '0000002',
|
||||
'ora' => '0100',
|
||||
'oră' => '0100',
|
||||
'orc' => '0020',
|
||||
'ore' => '0100',
|
||||
'ori' => '0100',
|
||||
'oric' => '02000',
|
||||
'orî' => '0100',
|
||||
'oro' => '0100',
|
||||
'oru' => '0100',
|
||||
'osti' => '00500',
|
||||
'oși' => '0300',
|
||||
'otați' => '000004',
|
||||
'oti' => '0500',
|
||||
'otod' => '00300',
|
||||
'ou' => '030',
|
||||
'p' => '12',
|
||||
'pa' => '300',
|
||||
'părț' => '00030',
|
||||
'pc' => '230',
|
||||
'pecți' => '000002',
|
||||
'peț' => '0020',
|
||||
'pie' => '0020',
|
||||
'piez' => '00300',
|
||||
'pio' => '0030',
|
||||
'piț' => '0020',
|
||||
'piz' => '0020',
|
||||
'pl' => '040',
|
||||
'poș' => '0040',
|
||||
'poț' => '0020',
|
||||
'ps' => '230',
|
||||
'pș' => '230',
|
||||
'pt' => '230',
|
||||
'pț' => '230',
|
||||
'pub' => '0034',
|
||||
'purie' => '000020',
|
||||
'puș' => '0040',
|
||||
'rb' => '200',
|
||||
'rc' => '200',
|
||||
'rd' => '200',
|
||||
're' => '020',
|
||||
'rebi' => '00200',
|
||||
'recizi' => '0000002',
|
||||
'rescr' => '003200',
|
||||
'reși' => '00400',
|
||||
'rf' => '200',
|
||||
'rg' => '200',
|
||||
'rh' => '210',
|
||||
'ria' => '0030',
|
||||
'riali' => '004000',
|
||||
'rieț' => '00300',
|
||||
'riez' => '00300',
|
||||
'rimi' => '00500',
|
||||
'riun' => '20300',
|
||||
'riv' => '0030',
|
||||
'rk' => '200',
|
||||
'rl' => '200',
|
||||
'rm' => '200',
|
||||
'rn' => '210',
|
||||
'rnaț' => '00020',
|
||||
'rografi' => '00000006',
|
||||
'rp' => '200',
|
||||
'rr' => '210',
|
||||
'rs' => '202',
|
||||
'rsp' => '0300',
|
||||
'rst' => '0300',
|
||||
'rș' => '230',
|
||||
'rt' => '200',
|
||||
'rtuale' => '0000200',
|
||||
'rț' => '200',
|
||||
'ruil' => '00300',
|
||||
'rusp' => '00300',
|
||||
'rv' => '200',
|
||||
'rz' => '200',
|
||||
's' => '10',
|
||||
'sa' => '500',
|
||||
'să' => '500',
|
||||
'săm' => '0040',
|
||||
'săș' => '0040',
|
||||
'sc' => '200',
|
||||
'sco' => '3200',
|
||||
'se' => '300',
|
||||
'sea' => '0020',
|
||||
'ses' => '0002',
|
||||
'sesp' => '00300',
|
||||
'seș' => '0040',
|
||||
'sf' => '420',
|
||||
'sfî' => '5000',
|
||||
'si' => '300',
|
||||
'sip' => '0030',
|
||||
'sî' => '300',
|
||||
'sl' => '340',
|
||||
'sm' => '400',
|
||||
'sn' => '010',
|
||||
'so' => '300',
|
||||
'soric' => '003000',
|
||||
'sp' => '200',
|
||||
'st' => '200',
|
||||
'sto' => '0003',
|
||||
'su' => '500',
|
||||
'suț' => '0020',
|
||||
'ș' => '20',
|
||||
'șa' => '300',
|
||||
'șaț' => '0020',
|
||||
'șă' => '302',
|
||||
'șe' => '300',
|
||||
'și' => '100',
|
||||
'șii' => '5000',
|
||||
'șil' => '5000',
|
||||
'șin' => '3000',
|
||||
'șî' => '300',
|
||||
'șn' => '450',
|
||||
'șnu' => '0005',
|
||||
'șo' => '300',
|
||||
'șp' => '020',
|
||||
'ști' => '0200',
|
||||
'ștr' => '4300',
|
||||
'șu' => '300',
|
||||
't' => '12',
|
||||
'taut' => '00300',
|
||||
'tc' => '230',
|
||||
'td' => '230',
|
||||
'tea' => '0020',
|
||||
'teni' => '00500',
|
||||
'terială' => '00006000',
|
||||
'tesp' => '00320',
|
||||
'tf' => '230',
|
||||
'tia' => '0030',
|
||||
'tie' => '0030',
|
||||
'til' => '3000',
|
||||
'tin' => '3000',
|
||||
'tiț' => '0020',
|
||||
'tl' => '040',
|
||||
'tm' => '230',
|
||||
'tol' => '3000',
|
||||
'tor' => '3000',
|
||||
'toto' => '00200',
|
||||
'trul' => '30000',
|
||||
'truo' => '30000',
|
||||
'ts' => '432',
|
||||
'tt' => '230',
|
||||
'tua' => '0030',
|
||||
'tuim' => '00300',
|
||||
'tun' => '4300',
|
||||
'tuș' => '0040',
|
||||
'tz' => '430',
|
||||
'ț' => '10',
|
||||
'ța' => '300',
|
||||
'ță' => '300',
|
||||
'țeț' => '0020',
|
||||
'ția' => '3000',
|
||||
'ție' => '3000',
|
||||
'ții' => '3000',
|
||||
'țil' => '3000',
|
||||
'țiț' => '0020',
|
||||
'țiu' => '3000',
|
||||
'țu' => '003',
|
||||
'țui' => '0050',
|
||||
'u' => '21',
|
||||
'uad' => '0200',
|
||||
'uau' => '0300',
|
||||
'uă' => '003',
|
||||
'uăs' => '0002',
|
||||
'ubia' => '02000',
|
||||
'ubl' => '0230',
|
||||
'ubo' => '0210',
|
||||
'ubs' => '0032',
|
||||
'ue' => '030',
|
||||
'ugu' => '4000',
|
||||
'uia' => '0320',
|
||||
'uie' => '0320',
|
||||
'uin' => '0300',
|
||||
'uir' => '0300',
|
||||
'uis' => '0300',
|
||||
'uit' => '0300',
|
||||
'uiț' => '0320',
|
||||
'uiz' => '0300',
|
||||
'ul' => '020',
|
||||
'ula' => '0300',
|
||||
'ulă' => '0300',
|
||||
'ule' => '0300',
|
||||
'ulii' => '03000',
|
||||
'ulî' => '0300',
|
||||
'ulo' => '0300',
|
||||
'umir' => '00050',
|
||||
'urz' => '0020',
|
||||
'us' => '020',
|
||||
'uspr' => '00200',
|
||||
'ust' => '0400',
|
||||
'uș' => '030',
|
||||
'ușt' => '0400',
|
||||
'uto' => '0200',
|
||||
'utor' => '30000',
|
||||
'uui' => '0300',
|
||||
'uum' => '0300',
|
||||
'v' => '10',
|
||||
'veni' => '00500',
|
||||
'veț' => '0020',
|
||||
'vez' => '0020',
|
||||
'viț' => '0020',
|
||||
'vn' => '210',
|
||||
'vorbito' => '00000002',
|
||||
'vr' => '300',
|
||||
'x' => '10',
|
||||
'xa' => '300',
|
||||
'xă' => '300',
|
||||
'xe' => '300',
|
||||
'xez' => '0020',
|
||||
'xi' => '300',
|
||||
'xo' => '300',
|
||||
'xu' => '300',
|
||||
'z' => '10',
|
||||
'zaț' => '0020',
|
||||
'zb' => '200',
|
||||
'zg' => '220',
|
||||
'zian' => '00200',
|
||||
'ziar' => '00200',
|
||||
'zii' => '3000',
|
||||
'zil' => '3000',
|
||||
'zm' => '040',
|
||||
'zn' => '210',
|
||||
'zol' => '3200',
|
||||
'zon' => '3000',
|
||||
'zuț' => '0020',
|
||||
'zv' => '220',
|
||||
'zvă' => '0300',
|
||||
),
|
||||
);
|
||||
|
||||
7318
site/OFF_plugins/typography/php-typography/lang/ru.php
Normal file
7318
site/OFF_plugins/typography/php-typography/lang/ru.php
Normal file
File diff suppressed because it is too large
Load diff
831
site/OFF_plugins/typography/php-typography/lang/sa.php
Normal file
831
site/OFF_plugins/typography/php-typography/lang/sa.php
Normal file
|
|
@ -0,0 +1,831 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Project: wp-Typography
|
||||
Project URI: https://code.mundschenk.at/wp-typography/
|
||||
|
||||
File modified to place pattern and exceptions in arrays that can be understood in php files.
|
||||
This file is released under the same copyright as the below referenced original file
|
||||
Original unmodified file is available at: http://ctan.mirrorcatalogs.com/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/
|
||||
Original file name: hyph-sa.tex
|
||||
|
||||
//============================================================================================================
|
||||
ORIGINAL FILE INFO
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
% File name: hyph-sa.tex
|
||||
%
|
||||
% Unicode hyphenation patterns for Sanskrit and Prakrit in transliteration,
|
||||
% and in Devanagari, Bengali, Kannada, Malayalam and Telugu scripts.
|
||||
%
|
||||
% Created: April 1st, 2005
|
||||
% First release: June 8th, 2006
|
||||
% Revised: September 14th, 2011
|
||||
% Version: 0.6
|
||||
%
|
||||
% Created by Yves Codet. Special thanks to Jonathan Kew and Benjamin Varghese who provided very useful informations.
|
||||
%
|
||||
% Copyright 2006-2011 Yves Codet.
|
||||
% You may freely use, copy, modify and/or distribute this file.
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
//============================================================================================================
|
||||
|
||||
*/
|
||||
|
||||
$patgenLanguage = 'Sanskrit';
|
||||
|
||||
$patgenExceptions = array();
|
||||
|
||||
$patgenMaxSeg = 4;
|
||||
|
||||
$patgen = array(
|
||||
'begin' => array( ),
|
||||
|
||||
'end' => array(
|
||||
'k' => '20',
|
||||
'kh' => '200',
|
||||
'g' => '20',
|
||||
'gh' => '200',
|
||||
'ṅ' => '200',
|
||||
'c' => '20',
|
||||
'ch' => '200',
|
||||
'j' => '20',
|
||||
'jh' => '200',
|
||||
'ñ' => '200',
|
||||
'ṭ' => '200',
|
||||
'ṭh' => '2000',
|
||||
'ḍ' => '200',
|
||||
'ḍh' => '2000',
|
||||
'ṇ' => '200',
|
||||
't' => '20',
|
||||
'th' => '200',
|
||||
'd' => '20',
|
||||
'dh' => '200',
|
||||
'n' => '20',
|
||||
'p' => '20',
|
||||
'ph' => '200',
|
||||
'b' => '20',
|
||||
'bh' => '200',
|
||||
'm' => '20',
|
||||
'y' => '20',
|
||||
'r' => '20',
|
||||
'l' => '20',
|
||||
'ḷ' => '200',
|
||||
'v' => '20',
|
||||
'ś' => '200',
|
||||
'ṣ' => '200',
|
||||
's' => '20',
|
||||
'h' => '20',
|
||||
'rk' => '200',
|
||||
'rg' => '200',
|
||||
'rṭ' => '2000',
|
||||
'rḍ' => '2000',
|
||||
'rt' => '200',
|
||||
'rd' => '200',
|
||||
'rp' => '200',
|
||||
'rb' => '200',
|
||||
'ṅ' => '20',
|
||||
'ñ' => '20',
|
||||
'ṭ' => '20',
|
||||
'ṭh' => '200',
|
||||
'ḍ' => '20',
|
||||
'ḍh' => '200',
|
||||
'ṇ' => '20',
|
||||
'ḷ' => '20',
|
||||
'ś' => '20',
|
||||
'ṣ' => '20',
|
||||
'rṭ' => '200',
|
||||
'rḍ' => '200',
|
||||
'क्' => '200',
|
||||
'ख्' => '200',
|
||||
'ग्' => '200',
|
||||
'घ्' => '200',
|
||||
'ङ्' => '200',
|
||||
'च्' => '200',
|
||||
'छ्' => '200',
|
||||
'ज्' => '200',
|
||||
'झ्' => '200',
|
||||
'ञ्' => '200',
|
||||
'ट्' => '200',
|
||||
'ठ्' => '200',
|
||||
'ड्' => '200',
|
||||
'ढ्' => '200',
|
||||
'ण्' => '200',
|
||||
'त्' => '200',
|
||||
'थ्' => '200',
|
||||
'द्' => '200',
|
||||
'ध्' => '200',
|
||||
'न्' => '200',
|
||||
'प्' => '200',
|
||||
'फ्' => '200',
|
||||
'ब्' => '200',
|
||||
'भ्' => '200',
|
||||
'म्' => '200',
|
||||
'य्' => '200',
|
||||
'र्' => '200',
|
||||
'ल्' => '200',
|
||||
'ळ्' => '200',
|
||||
'व्' => '200',
|
||||
'श्' => '200',
|
||||
'ष्' => '200',
|
||||
'स्' => '200',
|
||||
'ह्' => '200',
|
||||
'र्क्' => '20000',
|
||||
'र्ट्' => '20000',
|
||||
'र्त्' => '20000',
|
||||
'र्प्' => '20000',
|
||||
'ক্' => '200',
|
||||
'খ্' => '200',
|
||||
'গ্' => '200',
|
||||
'ঘ্' => '200',
|
||||
'ঙ্' => '200',
|
||||
'চ্' => '200',
|
||||
'ছ্' => '200',
|
||||
'জ্' => '200',
|
||||
'ঝ্' => '200',
|
||||
'ঞ্' => '200',
|
||||
'ট্' => '200',
|
||||
'ঠ্' => '200',
|
||||
'ড্' => '200',
|
||||
'ড়্' => '200',
|
||||
'ঢ্' => '200',
|
||||
'ঢ়্' => '200',
|
||||
'ণ্' => '200',
|
||||
'ত্' => '200',
|
||||
'থ্' => '200',
|
||||
'দ্' => '200',
|
||||
'ধ্' => '200',
|
||||
'ন্' => '200',
|
||||
'প্' => '200',
|
||||
'ফ্' => '200',
|
||||
'ব্' => '200',
|
||||
'ভ্' => '200',
|
||||
'ম্' => '200',
|
||||
'য্' => '200',
|
||||
'য়্' => '200',
|
||||
'র্' => '200',
|
||||
'ল্' => '200',
|
||||
'শ্' => '200',
|
||||
'ষ্' => '200',
|
||||
'স্' => '200',
|
||||
'হ্' => '200',
|
||||
'র্ক' => '2000',
|
||||
'র্ট' => '2000',
|
||||
'র্ত' => '2000',
|
||||
'র্প' => '2000',
|
||||
'ક્' => '200',
|
||||
'ખ્' => '200',
|
||||
'ગ્' => '200',
|
||||
'ઘ્' => '200',
|
||||
'ઙ્' => '200',
|
||||
'ચ્' => '200',
|
||||
'છ્' => '200',
|
||||
'જ્' => '200',
|
||||
'ઝ્' => '200',
|
||||
'ઞ્' => '200',
|
||||
'ટ્' => '200',
|
||||
'ઠ્' => '200',
|
||||
'ડ્' => '200',
|
||||
'ઢ્' => '200',
|
||||
'ણ્' => '200',
|
||||
'ત્' => '200',
|
||||
'થ્' => '200',
|
||||
'દ્' => '200',
|
||||
'ધ્' => '200',
|
||||
'ન્' => '200',
|
||||
'પ્' => '200',
|
||||
'ફ્' => '200',
|
||||
'બ્' => '200',
|
||||
'ભ્' => '200',
|
||||
'મ્' => '200',
|
||||
'ય્' => '200',
|
||||
'ર્' => '200',
|
||||
'લ્' => '200',
|
||||
'ળ્' => '200',
|
||||
'વ્' => '200',
|
||||
'શ્' => '200',
|
||||
'ષ્' => '200',
|
||||
'સ્' => '200',
|
||||
'હ્' => '200',
|
||||
'ર્ક' => '2000',
|
||||
'ર્ટ' => '2000',
|
||||
'ર્ત' => '2000',
|
||||
'ર્પ' => '2000',
|
||||
'ಕ್' => '200',
|
||||
'ಖ್' => '200',
|
||||
'ಗ್' => '200',
|
||||
'ಘ್' => '200',
|
||||
'ಙ್' => '200',
|
||||
'ಚ್' => '200',
|
||||
'ಛ್' => '200',
|
||||
'ಜ್' => '200',
|
||||
'ಝ್' => '200',
|
||||
'ಞ್' => '200',
|
||||
'ಟ್' => '200',
|
||||
'ಠ್' => '200',
|
||||
'ಡ್' => '200',
|
||||
'ಢ್' => '200',
|
||||
'ಣ್' => '200',
|
||||
'ತ್' => '200',
|
||||
'ಥ್' => '200',
|
||||
'ದ್' => '200',
|
||||
'ಧ್' => '200',
|
||||
'ನ್' => '200',
|
||||
'ಪ್' => '200',
|
||||
'ಫ್' => '200',
|
||||
'ಬ್' => '200',
|
||||
'ಭ್' => '200',
|
||||
'ಮ್' => '200',
|
||||
'ಯ್' => '200',
|
||||
'ರ್' => '200',
|
||||
'ಱ್' => '200',
|
||||
'ಲ್' => '200',
|
||||
'ಳ್' => '200',
|
||||
'ವ್' => '200',
|
||||
'ಶ್' => '200',
|
||||
'ಷ್' => '200',
|
||||
'ಸ್' => '200',
|
||||
'ಹ್' => '200',
|
||||
'ರ್ಕ' => '2000',
|
||||
'ರ್ಟ' => '2000',
|
||||
'ರ್ತ' => '2000',
|
||||
'ರ್ಪ' => '2000',
|
||||
'ക്' => '200',
|
||||
'ഖ്' => '200',
|
||||
'ഗ്' => '200',
|
||||
'ഘ്' => '200',
|
||||
'ങ്' => '200',
|
||||
'ച്' => '200',
|
||||
'ഛ്' => '200',
|
||||
'ജ്' => '200',
|
||||
'ഝ്' => '200',
|
||||
'ഞ്' => '200',
|
||||
'ട്' => '200',
|
||||
'ഠ്' => '200',
|
||||
'ഡ്' => '200',
|
||||
'ഢ്' => '200',
|
||||
'ണ്' => '200',
|
||||
'ത്' => '200',
|
||||
'ഥ്' => '200',
|
||||
'ദ്' => '200',
|
||||
'ധ്' => '200',
|
||||
'ന്' => '200',
|
||||
'പ്' => '200',
|
||||
'ഫ്' => '200',
|
||||
'ബ്' => '200',
|
||||
'ഭ്' => '200',
|
||||
'മ്' => '200',
|
||||
'യ്' => '200',
|
||||
'ര്' => '200',
|
||||
'റ്' => '200',
|
||||
'ല്' => '200',
|
||||
'ള്' => '200',
|
||||
'ഴ്' => '200',
|
||||
'വ്' => '200',
|
||||
'ശ്' => '200',
|
||||
'ഷ്' => '200',
|
||||
'സ്' => '200',
|
||||
'ഹ്' => '200',
|
||||
'ര്ക' => '2000',
|
||||
'ര്ട' => '2000',
|
||||
'ര്ത' => '2000',
|
||||
'ര്പ' => '2000',
|
||||
'క్' => '200',
|
||||
'ఖ్' => '200',
|
||||
'గ్' => '200',
|
||||
'ఘ్' => '200',
|
||||
'ఙ్' => '200',
|
||||
'చ్' => '200',
|
||||
'ఛ్' => '200',
|
||||
'జ్' => '200',
|
||||
'ఝ్' => '200',
|
||||
'ఞ్' => '200',
|
||||
'ట్' => '200',
|
||||
'ఠ్' => '200',
|
||||
'డ్' => '200',
|
||||
'ఢ్' => '200',
|
||||
'ణ్' => '200',
|
||||
'త్' => '200',
|
||||
'థ్' => '200',
|
||||
'ద్' => '200',
|
||||
'ధ్' => '200',
|
||||
'న్' => '200',
|
||||
'ప్' => '200',
|
||||
'ఫ్' => '200',
|
||||
'బ్' => '200',
|
||||
'భ్' => '200',
|
||||
'మ్' => '200',
|
||||
'య్' => '200',
|
||||
'ర్' => '200',
|
||||
'ఱ్' => '200',
|
||||
'ల్' => '200',
|
||||
'ళ్' => '200',
|
||||
'వ్' => '200',
|
||||
'శ్' => '200',
|
||||
'ష్' => '200',
|
||||
'స్' => '200',
|
||||
'హ్' => '200',
|
||||
'ర్క్' => '20000',
|
||||
'ర్ట్' => '20000',
|
||||
'ర్త్' => '20000',
|
||||
'ర్ప్' => '20000',
|
||||
),
|
||||
|
||||
'all' => array(
|
||||
'' => '22',
|
||||
'' => '22',
|
||||
'a' => '01',
|
||||
'ā' => '001',
|
||||
'i' => '01',
|
||||
'ï' => '001',
|
||||
'ī' => '001',
|
||||
'u' => '01',
|
||||
'ü' => '001',
|
||||
'ū' => '001',
|
||||
'r̥' => '001',
|
||||
'ṛ' => '001',
|
||||
'r̥̄' => '0001',
|
||||
'ṝ' => '0001',
|
||||
'l̥' => '001',
|
||||
'ḷ' => '001',
|
||||
'l̥̄' => '0001',
|
||||
'ḹ' => '0001',
|
||||
'e' => '01',
|
||||
'o' => '01',
|
||||
'ai' => '021',
|
||||
'au' => '021',
|
||||
'aï' => '0301',
|
||||
'aü' => '0301',
|
||||
'ṃ' => '201',
|
||||
'ṁ' => '201',
|
||||
'm̐' => '201',
|
||||
'ḥ' => '201',
|
||||
'ẖ' => '201',
|
||||
'ḫ' => '201',
|
||||
'̮' => '20',
|
||||
'̐' => '20',
|
||||
'̄' => '20',
|
||||
'̱' => '21',
|
||||
'́' => '21',
|
||||
'̀' => '21',
|
||||
'̈' => '20',
|
||||
'á' => '01',
|
||||
'à' => '01',
|
||||
'ā' => '01',
|
||||
'í' => '01',
|
||||
'ì' => '01',
|
||||
'ï' => '01',
|
||||
'ī' => '01',
|
||||
'ú' => '01',
|
||||
'ù' => '01',
|
||||
'ü' => '01',
|
||||
'ū' => '01',
|
||||
'é' => '01',
|
||||
'è' => '01',
|
||||
'ó' => '01',
|
||||
'ò' => '01',
|
||||
'aí' => '021',
|
||||
'aì' => '021',
|
||||
'aú' => '021',
|
||||
'aù' => '021',
|
||||
'aï' => '031',
|
||||
'aü' => '031',
|
||||
'ṃ' => '21',
|
||||
'ṁ' => '21',
|
||||
'ḥ' => '21',
|
||||
'ẖ' => '21',
|
||||
'ḫ' => '21',
|
||||
'अ' => '11',
|
||||
'आ' => '11',
|
||||
'इ' => '11',
|
||||
'ई' => '11',
|
||||
'उ' => '11',
|
||||
'ऊ' => '11',
|
||||
'ऋ' => '11',
|
||||
'ॠ' => '11',
|
||||
'ऌ' => '11',
|
||||
'ॡ' => '11',
|
||||
'ए' => '11',
|
||||
'ऐ' => '11',
|
||||
'ओ' => '11',
|
||||
'औ' => '11',
|
||||
'ा' => '21',
|
||||
'ि' => '21',
|
||||
'ी' => '21',
|
||||
'ु' => '21',
|
||||
'ू' => '21',
|
||||
'ृ' => '21',
|
||||
'ॄ' => '21',
|
||||
'ॢ' => '21',
|
||||
'ॣ' => '21',
|
||||
'े' => '21',
|
||||
'ै' => '21',
|
||||
'ो' => '21',
|
||||
'ौ' => '21',
|
||||
'क' => '11',
|
||||
'ख' => '11',
|
||||
'ग' => '11',
|
||||
'घ' => '11',
|
||||
'ङ' => '11',
|
||||
'च' => '11',
|
||||
'छ' => '11',
|
||||
'ज' => '11',
|
||||
'झ' => '11',
|
||||
'ञ' => '11',
|
||||
'ट' => '11',
|
||||
'ठ' => '11',
|
||||
'ड' => '11',
|
||||
'ढ' => '11',
|
||||
'ण' => '11',
|
||||
'त' => '11',
|
||||
'थ' => '11',
|
||||
'द' => '11',
|
||||
'ध' => '11',
|
||||
'न' => '11',
|
||||
'प' => '11',
|
||||
'फ' => '11',
|
||||
'ब' => '11',
|
||||
'भ' => '11',
|
||||
'म' => '11',
|
||||
'य' => '11',
|
||||
'र' => '11',
|
||||
'ल' => '11',
|
||||
'ळ' => '11',
|
||||
'व' => '11',
|
||||
'श' => '11',
|
||||
'ष' => '11',
|
||||
'स' => '11',
|
||||
'ह' => '11',
|
||||
'ँ' => '20',
|
||||
'ं' => '20',
|
||||
'ः' => '20',
|
||||
'ऽ' => '22',
|
||||
'॑' => '20',
|
||||
'॒' => '20',
|
||||
'्' => '22',
|
||||
'অ' => '11',
|
||||
'আ' => '11',
|
||||
'ই' => '11',
|
||||
'ঈ' => '11',
|
||||
'উ' => '11',
|
||||
'ঊ' => '11',
|
||||
'ঋ' => '11',
|
||||
'ৠ' => '11',
|
||||
'ঌ' => '11',
|
||||
'ৡ' => '11',
|
||||
'এ' => '11',
|
||||
'ঐ' => '11',
|
||||
'ও' => '11',
|
||||
'ঔ' => '11',
|
||||
'া' => '21',
|
||||
'ি' => '21',
|
||||
'ী' => '21',
|
||||
'ু' => '21',
|
||||
'ূ' => '21',
|
||||
'ৃ' => '21',
|
||||
'ৄ' => '21',
|
||||
'ৢ' => '21',
|
||||
'ৣ' => '21',
|
||||
'ে' => '21',
|
||||
'ৈ' => '21',
|
||||
'ো' => '21',
|
||||
'ৌ' => '21',
|
||||
'ক' => '11',
|
||||
'খ' => '11',
|
||||
'গ' => '11',
|
||||
'ঘ' => '11',
|
||||
'ঙ' => '11',
|
||||
'চ' => '11',
|
||||
'ছ' => '11',
|
||||
'জ' => '11',
|
||||
'ঝ' => '11',
|
||||
'ঞ' => '11',
|
||||
'ট' => '11',
|
||||
'ঠ' => '11',
|
||||
'ড' => '11',
|
||||
'ড়' => '11',
|
||||
'ঢ' => '11',
|
||||
'ঢ়' => '11',
|
||||
'ণ' => '11',
|
||||
'ত' => '11',
|
||||
'থ' => '11',
|
||||
'দ' => '11',
|
||||
'ধ' => '11',
|
||||
'ন' => '11',
|
||||
'প' => '11',
|
||||
'ফ' => '11',
|
||||
'ব' => '11',
|
||||
'ভ' => '11',
|
||||
'ম' => '11',
|
||||
'য' => '11',
|
||||
'য়' => '11',
|
||||
'র' => '11',
|
||||
'ল' => '11',
|
||||
'শ' => '11',
|
||||
'ষ' => '11',
|
||||
'স' => '11',
|
||||
'হ' => '11',
|
||||
'ৎ' => '12',
|
||||
'ঁ' => '20',
|
||||
'ং' => '20',
|
||||
'ঃ' => '20',
|
||||
'ঽ' => '22',
|
||||
'়' => '20',
|
||||
'ৗ' => '20',
|
||||
'্' => '22',
|
||||
'અ' => '11',
|
||||
'આ' => '11',
|
||||
'ઇ' => '11',
|
||||
'ઈ' => '11',
|
||||
'ઉ' => '11',
|
||||
'ઊ' => '11',
|
||||
'ઋ' => '11',
|
||||
'ૠ' => '11',
|
||||
'ઌ' => '11',
|
||||
'ૡ' => '11',
|
||||
'એ' => '11',
|
||||
'ઐ' => '11',
|
||||
'ઓ' => '11',
|
||||
'ઔ' => '11',
|
||||
'ા' => '21',
|
||||
'િ' => '21',
|
||||
'ી' => '21',
|
||||
'ુ' => '21',
|
||||
'ૂ' => '21',
|
||||
'ૃ' => '21',
|
||||
'ૄ' => '21',
|
||||
'ૢ' => '21',
|
||||
'ૣ' => '21',
|
||||
'ે' => '21',
|
||||
'ૈ' => '21',
|
||||
'ો' => '21',
|
||||
'ૌ' => '21',
|
||||
'ક' => '11',
|
||||
'ખ' => '11',
|
||||
'ગ' => '11',
|
||||
'ઘ' => '11',
|
||||
'ઙ' => '11',
|
||||
'ચ' => '11',
|
||||
'છ' => '11',
|
||||
'જ' => '11',
|
||||
'ઝ' => '11',
|
||||
'ઞ' => '11',
|
||||
'ટ' => '11',
|
||||
'ઠ' => '11',
|
||||
'ડ' => '11',
|
||||
'ઢ' => '11',
|
||||
'ણ' => '11',
|
||||
'ત' => '11',
|
||||
'થ' => '11',
|
||||
'દ' => '11',
|
||||
'ધ' => '11',
|
||||
'ન' => '11',
|
||||
'પ' => '11',
|
||||
'ફ' => '11',
|
||||
'બ' => '11',
|
||||
'ભ' => '11',
|
||||
'મ' => '11',
|
||||
'ય' => '11',
|
||||
'ર' => '11',
|
||||
'લ' => '11',
|
||||
'ળ' => '11',
|
||||
'વ' => '11',
|
||||
'શ' => '11',
|
||||
'ષ' => '11',
|
||||
'સ' => '11',
|
||||
'હ' => '11',
|
||||
'ઁ' => '20',
|
||||
'ં' => '20',
|
||||
'ઃ' => '20',
|
||||
'ઽ' => '22',
|
||||
'્' => '22',
|
||||
'ಅ' => '11',
|
||||
'ಆ' => '11',
|
||||
'ಇ' => '11',
|
||||
'ಈ' => '11',
|
||||
'ಉ' => '11',
|
||||
'ಊ' => '11',
|
||||
'ಋ' => '11',
|
||||
'ೠ' => '11',
|
||||
'ಌ' => '11',
|
||||
'ೡ' => '11',
|
||||
'ಎ' => '11',
|
||||
'ಏ' => '11',
|
||||
'ಐ' => '11',
|
||||
'ಒ' => '11',
|
||||
'ಓ' => '11',
|
||||
'ಔ' => '11',
|
||||
'ಾ' => '21',
|
||||
'ಿ' => '21',
|
||||
'ೀ' => '21',
|
||||
'ು' => '21',
|
||||
'ೂ' => '21',
|
||||
'ೃ' => '21',
|
||||
'ೄ' => '21',
|
||||
'ೆ' => '21',
|
||||
'ೇ' => '21',
|
||||
'ೈ' => '21',
|
||||
'ೊ' => '21',
|
||||
'ೋ' => '21',
|
||||
'ೌ' => '21',
|
||||
'ಕ' => '11',
|
||||
'ಖ' => '11',
|
||||
'ಗ' => '11',
|
||||
'ಘ' => '11',
|
||||
'ಙ' => '11',
|
||||
'ಚ' => '11',
|
||||
'ಛ' => '11',
|
||||
'ಜ' => '11',
|
||||
'ಝ' => '11',
|
||||
'ಞ' => '11',
|
||||
'ಟ' => '11',
|
||||
'ಠ' => '11',
|
||||
'ಡ' => '11',
|
||||
'ಢ' => '11',
|
||||
'ಣ' => '11',
|
||||
'ತ' => '11',
|
||||
'ಥ' => '11',
|
||||
'ದ' => '11',
|
||||
'ಧ' => '11',
|
||||
'ನ' => '11',
|
||||
'ಪ' => '11',
|
||||
'ಫ' => '11',
|
||||
'ಬ' => '11',
|
||||
'ಭ' => '11',
|
||||
'ಮ' => '11',
|
||||
'ಯ' => '11',
|
||||
'ರ' => '11',
|
||||
'ಱ' => '11',
|
||||
'ಲ' => '11',
|
||||
'ಳ' => '11',
|
||||
'ೞ' => '11',
|
||||
'ವ' => '11',
|
||||
'ಶ' => '11',
|
||||
'ಷ' => '11',
|
||||
'ಸ' => '11',
|
||||
'ಹ' => '11',
|
||||
'ಂ' => '20',
|
||||
'ಃ' => '20',
|
||||
'ೱ' => '20',
|
||||
'ೲ' => '20',
|
||||
'ಽ' => '22',
|
||||
'ೕ' => '20',
|
||||
'ೖ' => '20',
|
||||
'್' => '22',
|
||||
'അ' => '11',
|
||||
'ആ' => '11',
|
||||
'ഇ' => '11',
|
||||
'ഈ' => '11',
|
||||
'ഉ' => '11',
|
||||
'ഊ' => '11',
|
||||
'ഋ' => '11',
|
||||
'ൠ' => '11',
|
||||
'ഌ' => '11',
|
||||
'ൡ' => '11',
|
||||
'എ' => '11',
|
||||
'ഏ' => '11',
|
||||
'ഐ' => '11',
|
||||
'ഒ' => '11',
|
||||
'ഓ' => '11',
|
||||
'ഔ' => '11',
|
||||
'ാ' => '21',
|
||||
'ി' => '21',
|
||||
'ീ' => '21',
|
||||
'ു' => '21',
|
||||
'ൂ' => '21',
|
||||
'ൃ' => '21',
|
||||
'െ' => '21',
|
||||
'േ' => '21',
|
||||
'ൈ' => '21',
|
||||
'ൊ' => '21',
|
||||
'ോ' => '21',
|
||||
'ൌ' => '21',
|
||||
'ക' => '11',
|
||||
'ഖ' => '11',
|
||||
'ഗ' => '11',
|
||||
'ഘ' => '11',
|
||||
'ങ' => '11',
|
||||
'ച' => '11',
|
||||
'ഛ' => '11',
|
||||
'ജ' => '11',
|
||||
'ഝ' => '11',
|
||||
'ഞ' => '11',
|
||||
'ട' => '11',
|
||||
'ഠ' => '11',
|
||||
'ഡ' => '11',
|
||||
'ഢ' => '11',
|
||||
'ണ' => '11',
|
||||
'ത' => '11',
|
||||
'ഥ' => '11',
|
||||
'ദ' => '11',
|
||||
'ധ' => '11',
|
||||
'ന' => '11',
|
||||
'പ' => '11',
|
||||
'ഫ' => '11',
|
||||
'ബ' => '11',
|
||||
'ഭ' => '11',
|
||||
'മ' => '11',
|
||||
'യ' => '11',
|
||||
'ര' => '11',
|
||||
'റ' => '11',
|
||||
'ല' => '11',
|
||||
'ള' => '11',
|
||||
'ഴ' => '11',
|
||||
'വ' => '11',
|
||||
'ശ' => '11',
|
||||
'ഷ' => '11',
|
||||
'സ' => '11',
|
||||
'ഹ' => '11',
|
||||
'ൺ' => '21',
|
||||
'ൻ' => '21',
|
||||
'ർ' => '21',
|
||||
'ൽ' => '21',
|
||||
'ൾ' => '21',
|
||||
'ൿ' => '21',
|
||||
'ണ്' => '2001',
|
||||
'ന്' => '2001',
|
||||
'ര്' => '2001',
|
||||
'ല്' => '2001',
|
||||
'ത്' => '2001',
|
||||
'ള്' => '2001',
|
||||
'ക്' => '2001',
|
||||
'ം' => '20',
|
||||
'ഃ' => '20',
|
||||
'ൗ' => '20',
|
||||
'്' => '22',
|
||||
'అ' => '11',
|
||||
'ఆ' => '11',
|
||||
'ఇ' => '11',
|
||||
'ఈ' => '11',
|
||||
'ఉ' => '11',
|
||||
'ఊ' => '11',
|
||||
'ఋ' => '11',
|
||||
'ౠ' => '11',
|
||||
'ఌ' => '11',
|
||||
'ౡ' => '11',
|
||||
'ఎ' => '11',
|
||||
'ఏ' => '11',
|
||||
'ఐ' => '11',
|
||||
'ఒ' => '11',
|
||||
'ఓ' => '11',
|
||||
'ఔ' => '11',
|
||||
'ా' => '21',
|
||||
'ి' => '21',
|
||||
'ీ' => '21',
|
||||
'ు' => '21',
|
||||
'ూ' => '21',
|
||||
'ృ' => '21',
|
||||
'ౄ' => '21',
|
||||
'ె' => '21',
|
||||
'ే' => '21',
|
||||
'ై' => '21',
|
||||
'ొ' => '21',
|
||||
'ో' => '21',
|
||||
'ౌ' => '21',
|
||||
'క' => '11',
|
||||
'ఖ' => '11',
|
||||
'గ' => '11',
|
||||
'ఘ' => '11',
|
||||
'ఙ' => '11',
|
||||
'చ' => '11',
|
||||
'ఛ' => '11',
|
||||
'జ' => '11',
|
||||
'ఝ' => '11',
|
||||
'ఞ' => '11',
|
||||
'ట' => '11',
|
||||
'ఠ' => '11',
|
||||
'డ' => '11',
|
||||
'ఢ' => '11',
|
||||
'ణ' => '11',
|
||||
'త' => '11',
|
||||
'థ' => '11',
|
||||
'ద' => '11',
|
||||
'ధ' => '11',
|
||||
'న' => '11',
|
||||
'ప' => '11',
|
||||
'ఫ' => '11',
|
||||
'బ' => '11',
|
||||
'భ' => '11',
|
||||
'మ' => '11',
|
||||
'య' => '11',
|
||||
'ర' => '11',
|
||||
'ఱ' => '11',
|
||||
'ల' => '11',
|
||||
'ళ' => '11',
|
||||
'వ' => '11',
|
||||
'శ' => '11',
|
||||
'ష' => '11',
|
||||
'స' => '11',
|
||||
'హ' => '11',
|
||||
'ఁ' => '20',
|
||||
'ం' => '20',
|
||||
'ః' => '20',
|
||||
'ౕ' => '20',
|
||||
'ౖ' => '20',
|
||||
'్' => '22',
|
||||
),
|
||||
);
|
||||
|
||||
2865
site/OFF_plugins/typography/php-typography/lang/sh-Cyrl.php
Normal file
2865
site/OFF_plugins/typography/php-typography/lang/sh-Cyrl.php
Normal file
File diff suppressed because it is too large
Load diff
2882
site/OFF_plugins/typography/php-typography/lang/sh-Latn.php
Normal file
2882
site/OFF_plugins/typography/php-typography/lang/sh-Latn.php
Normal file
File diff suppressed because it is too large
Load diff
2595
site/OFF_plugins/typography/php-typography/lang/sk.php
Normal file
2595
site/OFF_plugins/typography/php-typography/lang/sk.php
Normal file
File diff suppressed because it is too large
Load diff
1197
site/OFF_plugins/typography/php-typography/lang/sl.php
Normal file
1197
site/OFF_plugins/typography/php-typography/lang/sl.php
Normal file
File diff suppressed because it is too large
Load diff
2671
site/OFF_plugins/typography/php-typography/lang/sr-Cyrl.php
Normal file
2671
site/OFF_plugins/typography/php-typography/lang/sr-Cyrl.php
Normal file
File diff suppressed because it is too large
Load diff
4840
site/OFF_plugins/typography/php-typography/lang/sv.php
Normal file
4840
site/OFF_plugins/typography/php-typography/lang/sv.php
Normal file
File diff suppressed because it is too large
Load diff
4345
site/OFF_plugins/typography/php-typography/lang/th.php
Normal file
4345
site/OFF_plugins/typography/php-typography/lang/th.php
Normal file
File diff suppressed because it is too large
Load diff
2424
site/OFF_plugins/typography/php-typography/lang/tk.php
Normal file
2424
site/OFF_plugins/typography/php-typography/lang/tk.php
Normal file
File diff suppressed because it is too large
Load diff
667
site/OFF_plugins/typography/php-typography/lang/tr.php
Normal file
667
site/OFF_plugins/typography/php-typography/lang/tr.php
Normal file
|
|
@ -0,0 +1,667 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Project: wp-Typography
|
||||
Project URI: https://code.mundschenk.at/wp-typography/
|
||||
|
||||
File modified to place pattern and exceptions in arrays that can be understood in php files.
|
||||
This file is released under the same copyright as the below referenced original file
|
||||
Original unmodified file is available at: http://ctan.mirrorcatalogs.com/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/
|
||||
Original file name: hyph-tr.tex
|
||||
|
||||
//============================================================================================================
|
||||
ORIGINAL FILE INFO
|
||||
|
||||
% hyph-tr.tex
|
||||
%
|
||||
% Turkish hyphenation patterns
|
||||
%
|
||||
% This file is auto-generated from source/generic/hyph-utf8/languages/tr/generate_patterns_tr.rb that is part of hyph-utf8.
|
||||
% Please don't modify this file; modify the generating script instead.
|
||||
%
|
||||
% Copyright (C) 1987 Pierre A. MacKay
|
||||
% 2008, 2011 TUG
|
||||
%
|
||||
% This program can redistributed and/or modified under the terms
|
||||
% of the LaTeX Project Public License Distributed from CTAN
|
||||
% archives in directory macros/latex/base/lppl.txt; either
|
||||
% version 1 of the License, or (at your option) any later version.
|
||||
%
|
||||
% Credits:
|
||||
% - algorithm developed by P. A. MacKay for the Ottoman Texts Project in 1987
|
||||
% - rules adapted for modern Turkish by H. Turgut Uyar <uyar at itu.edu.tr>
|
||||
% - initiative to improve Turkish patterns by S. Ekin Kocabas <kocabas at stanford.edu>
|
||||
% - script written by Mojca Miklavec <mojca.miklavec.lists at gmail.com> in June 2008
|
||||
%
|
||||
% See also:
|
||||
% - http://mirror.ctan.org/language/turkish/hyphen/turk_hyf.c
|
||||
% - http://www.tug.org/TUGboat/Articles/tb09-1/tb20mackay.pdf
|
||||
%
|
||||
% Differences with Ottoman patterns:
|
||||
% - adapted for the use on modern TeX engines, using UTF-8 charactes
|
||||
% - only letters for Modern Turkish + âîû (the first one often needed, the other two don't hurt)
|
||||
% - (if needed, support for Ottoman Turkish might be provided separately under language code 'ota')
|
||||
%
|
||||
% Changes:
|
||||
% - 2008-06-25/27/28 - create this file by adapting Ottoman rules for modern Turkish
|
||||
% - 2011-08-10 - add LPPL licence with permission of Pierre A. MacKay
|
||||
%
|
||||
|
||||
|
||||
//============================================================================================================
|
||||
|
||||
*/
|
||||
|
||||
$patgenLanguage = 'Turkish';
|
||||
|
||||
$patgenExceptions = array();
|
||||
|
||||
$patgenMaxSeg = 5;
|
||||
|
||||
$patgen = array(
|
||||
'begin' => array( ),
|
||||
|
||||
'end' => array(
|
||||
'ecek' => '22000',
|
||||
),
|
||||
|
||||
'all' => array(
|
||||
'a' => '21',
|
||||
'â' => '21',
|
||||
'e' => '21',
|
||||
'ı' => '21',
|
||||
'i' => '21',
|
||||
'î' => '21',
|
||||
'o' => '21',
|
||||
'ö' => '21',
|
||||
'u' => '21',
|
||||
'ü' => '21',
|
||||
'û' => '21',
|
||||
'b' => '11',
|
||||
'c' => '11',
|
||||
'ç' => '11',
|
||||
'd' => '11',
|
||||
'f' => '11',
|
||||
'g' => '11',
|
||||
'ğ' => '11',
|
||||
'h' => '11',
|
||||
'j' => '11',
|
||||
'k' => '11',
|
||||
'l' => '11',
|
||||
'm' => '11',
|
||||
'n' => '11',
|
||||
'p' => '11',
|
||||
'r' => '11',
|
||||
's' => '11',
|
||||
'ş' => '11',
|
||||
't' => '11',
|
||||
'v' => '11',
|
||||
'y' => '11',
|
||||
'z' => '11',
|
||||
'bb' => '200',
|
||||
'bc' => '200',
|
||||
'bç' => '200',
|
||||
'bd' => '200',
|
||||
'bf' => '200',
|
||||
'bg' => '200',
|
||||
'bğ' => '200',
|
||||
'bh' => '200',
|
||||
'bj' => '200',
|
||||
'bk' => '200',
|
||||
'bl' => '200',
|
||||
'bm' => '200',
|
||||
'bn' => '200',
|
||||
'bp' => '200',
|
||||
'br' => '200',
|
||||
'bs' => '200',
|
||||
'bş' => '200',
|
||||
'bt' => '200',
|
||||
'bv' => '200',
|
||||
'by' => '200',
|
||||
'bz' => '200',
|
||||
'cb' => '200',
|
||||
'cc' => '200',
|
||||
'cç' => '200',
|
||||
'cd' => '200',
|
||||
'cf' => '200',
|
||||
'cg' => '200',
|
||||
'cğ' => '200',
|
||||
'ch' => '200',
|
||||
'cj' => '200',
|
||||
'ck' => '200',
|
||||
'cl' => '200',
|
||||
'cm' => '200',
|
||||
'cn' => '200',
|
||||
'cp' => '200',
|
||||
'cr' => '200',
|
||||
'cs' => '200',
|
||||
'cş' => '200',
|
||||
'ct' => '200',
|
||||
'cv' => '200',
|
||||
'cy' => '200',
|
||||
'cz' => '200',
|
||||
'çb' => '200',
|
||||
'çc' => '200',
|
||||
'çç' => '200',
|
||||
'çd' => '200',
|
||||
'çf' => '200',
|
||||
'çg' => '200',
|
||||
'çğ' => '200',
|
||||
'çh' => '200',
|
||||
'çj' => '200',
|
||||
'çk' => '200',
|
||||
'çl' => '200',
|
||||
'çm' => '200',
|
||||
'çn' => '200',
|
||||
'çp' => '200',
|
||||
'çr' => '200',
|
||||
'çs' => '200',
|
||||
'çş' => '200',
|
||||
'çt' => '200',
|
||||
'çv' => '200',
|
||||
'çy' => '200',
|
||||
'çz' => '200',
|
||||
'db' => '200',
|
||||
'dc' => '200',
|
||||
'dç' => '200',
|
||||
'dd' => '200',
|
||||
'df' => '200',
|
||||
'dg' => '200',
|
||||
'dğ' => '200',
|
||||
'dh' => '200',
|
||||
'dj' => '200',
|
||||
'dk' => '200',
|
||||
'dl' => '200',
|
||||
'dm' => '200',
|
||||
'dn' => '200',
|
||||
'dp' => '200',
|
||||
'dr' => '200',
|
||||
'ds' => '200',
|
||||
'dş' => '200',
|
||||
'dt' => '200',
|
||||
'dv' => '200',
|
||||
'dy' => '200',
|
||||
'dz' => '200',
|
||||
'fb' => '200',
|
||||
'fc' => '200',
|
||||
'fç' => '200',
|
||||
'fd' => '200',
|
||||
'ff' => '200',
|
||||
'fg' => '200',
|
||||
'fğ' => '200',
|
||||
'fh' => '200',
|
||||
'fj' => '200',
|
||||
'fk' => '200',
|
||||
'fl' => '200',
|
||||
'fm' => '200',
|
||||
'fn' => '200',
|
||||
'fp' => '200',
|
||||
'fr' => '200',
|
||||
'fs' => '200',
|
||||
'fş' => '200',
|
||||
'ft' => '200',
|
||||
'fv' => '200',
|
||||
'fy' => '200',
|
||||
'fz' => '200',
|
||||
'gb' => '200',
|
||||
'gc' => '200',
|
||||
'gç' => '200',
|
||||
'gd' => '200',
|
||||
'gf' => '200',
|
||||
'gg' => '200',
|
||||
'gğ' => '200',
|
||||
'gh' => '200',
|
||||
'gj' => '200',
|
||||
'gk' => '200',
|
||||
'gl' => '200',
|
||||
'gm' => '200',
|
||||
'gn' => '200',
|
||||
'gp' => '200',
|
||||
'gr' => '200',
|
||||
'gs' => '200',
|
||||
'gş' => '200',
|
||||
'gt' => '200',
|
||||
'gv' => '200',
|
||||
'gy' => '200',
|
||||
'gz' => '200',
|
||||
'ğb' => '200',
|
||||
'ğc' => '200',
|
||||
'ğç' => '200',
|
||||
'ğd' => '200',
|
||||
'ğf' => '200',
|
||||
'ğg' => '200',
|
||||
'ğğ' => '200',
|
||||
'ğh' => '200',
|
||||
'ğj' => '200',
|
||||
'ğk' => '200',
|
||||
'ğl' => '200',
|
||||
'ğm' => '200',
|
||||
'ğn' => '200',
|
||||
'ğp' => '200',
|
||||
'ğr' => '200',
|
||||
'ğs' => '200',
|
||||
'ğş' => '200',
|
||||
'ğt' => '200',
|
||||
'ğv' => '200',
|
||||
'ğy' => '200',
|
||||
'ğz' => '200',
|
||||
'hb' => '200',
|
||||
'hc' => '200',
|
||||
'hç' => '200',
|
||||
'hd' => '200',
|
||||
'hf' => '200',
|
||||
'hg' => '200',
|
||||
'hğ' => '200',
|
||||
'hh' => '200',
|
||||
'hj' => '200',
|
||||
'hk' => '200',
|
||||
'hl' => '200',
|
||||
'hm' => '200',
|
||||
'hn' => '200',
|
||||
'hp' => '200',
|
||||
'hr' => '200',
|
||||
'hs' => '200',
|
||||
'hş' => '200',
|
||||
'ht' => '200',
|
||||
'hv' => '200',
|
||||
'hy' => '200',
|
||||
'hz' => '200',
|
||||
'jb' => '200',
|
||||
'jc' => '200',
|
||||
'jç' => '200',
|
||||
'jd' => '200',
|
||||
'jf' => '200',
|
||||
'jg' => '200',
|
||||
'jğ' => '200',
|
||||
'jh' => '200',
|
||||
'jj' => '200',
|
||||
'jk' => '200',
|
||||
'jl' => '200',
|
||||
'jm' => '200',
|
||||
'jn' => '200',
|
||||
'jp' => '200',
|
||||
'jr' => '200',
|
||||
'js' => '200',
|
||||
'jş' => '200',
|
||||
'jt' => '200',
|
||||
'jv' => '200',
|
||||
'jy' => '200',
|
||||
'jz' => '200',
|
||||
'kb' => '200',
|
||||
'kc' => '200',
|
||||
'kç' => '200',
|
||||
'kd' => '200',
|
||||
'kf' => '200',
|
||||
'kg' => '200',
|
||||
'kğ' => '200',
|
||||
'kh' => '200',
|
||||
'kj' => '200',
|
||||
'kk' => '200',
|
||||
'kl' => '200',
|
||||
'km' => '200',
|
||||
'kn' => '200',
|
||||
'kp' => '200',
|
||||
'kr' => '200',
|
||||
'ks' => '200',
|
||||
'kş' => '200',
|
||||
'kt' => '200',
|
||||
'kv' => '200',
|
||||
'ky' => '200',
|
||||
'kz' => '200',
|
||||
'lb' => '200',
|
||||
'lc' => '200',
|
||||
'lç' => '200',
|
||||
'ld' => '200',
|
||||
'lf' => '200',
|
||||
'lg' => '200',
|
||||
'lğ' => '200',
|
||||
'lh' => '200',
|
||||
'lj' => '200',
|
||||
'lk' => '200',
|
||||
'll' => '200',
|
||||
'lm' => '200',
|
||||
'ln' => '200',
|
||||
'lp' => '200',
|
||||
'lr' => '200',
|
||||
'ls' => '200',
|
||||
'lş' => '200',
|
||||
'lt' => '200',
|
||||
'lv' => '200',
|
||||
'ly' => '200',
|
||||
'lz' => '200',
|
||||
'mb' => '200',
|
||||
'mc' => '200',
|
||||
'mç' => '200',
|
||||
'md' => '200',
|
||||
'mf' => '200',
|
||||
'mg' => '200',
|
||||
'mğ' => '200',
|
||||
'mh' => '200',
|
||||
'mj' => '200',
|
||||
'mk' => '200',
|
||||
'ml' => '200',
|
||||
'mm' => '200',
|
||||
'mn' => '200',
|
||||
'mp' => '200',
|
||||
'mr' => '200',
|
||||
'ms' => '200',
|
||||
'mş' => '200',
|
||||
'mt' => '200',
|
||||
'mv' => '200',
|
||||
'my' => '200',
|
||||
'mz' => '200',
|
||||
'nb' => '200',
|
||||
'nc' => '200',
|
||||
'nç' => '200',
|
||||
'nd' => '200',
|
||||
'nf' => '200',
|
||||
'ng' => '200',
|
||||
'nğ' => '200',
|
||||
'nh' => '200',
|
||||
'nj' => '200',
|
||||
'nk' => '200',
|
||||
'nl' => '200',
|
||||
'nm' => '200',
|
||||
'nn' => '200',
|
||||
'np' => '200',
|
||||
'nr' => '200',
|
||||
'ns' => '200',
|
||||
'nş' => '200',
|
||||
'nt' => '200',
|
||||
'nv' => '200',
|
||||
'ny' => '200',
|
||||
'nz' => '200',
|
||||
'pb' => '200',
|
||||
'pc' => '200',
|
||||
'pç' => '200',
|
||||
'pd' => '200',
|
||||
'pf' => '200',
|
||||
'pg' => '200',
|
||||
'pğ' => '200',
|
||||
'ph' => '200',
|
||||
'pj' => '200',
|
||||
'pk' => '200',
|
||||
'pl' => '200',
|
||||
'pm' => '200',
|
||||
'pn' => '200',
|
||||
'pp' => '200',
|
||||
'pr' => '200',
|
||||
'ps' => '200',
|
||||
'pş' => '200',
|
||||
'pt' => '200',
|
||||
'pv' => '200',
|
||||
'py' => '200',
|
||||
'pz' => '200',
|
||||
'rb' => '200',
|
||||
'rc' => '200',
|
||||
'rç' => '200',
|
||||
'rd' => '200',
|
||||
'rf' => '200',
|
||||
'rg' => '200',
|
||||
'rğ' => '200',
|
||||
'rh' => '200',
|
||||
'rj' => '200',
|
||||
'rk' => '200',
|
||||
'rl' => '200',
|
||||
'rm' => '200',
|
||||
'rn' => '200',
|
||||
'rp' => '200',
|
||||
'rr' => '200',
|
||||
'rs' => '200',
|
||||
'rş' => '200',
|
||||
'rt' => '200',
|
||||
'rv' => '200',
|
||||
'ry' => '200',
|
||||
'rz' => '200',
|
||||
'sb' => '200',
|
||||
'sc' => '200',
|
||||
'sç' => '200',
|
||||
'sd' => '200',
|
||||
'sf' => '200',
|
||||
'sg' => '200',
|
||||
'sğ' => '200',
|
||||
'sh' => '200',
|
||||
'sj' => '200',
|
||||
'sk' => '200',
|
||||
'sl' => '200',
|
||||
'sm' => '200',
|
||||
'sn' => '200',
|
||||
'sp' => '200',
|
||||
'sr' => '200',
|
||||
'ss' => '200',
|
||||
'sş' => '200',
|
||||
'st' => '200',
|
||||
'sv' => '200',
|
||||
'sy' => '200',
|
||||
'sz' => '200',
|
||||
'şb' => '200',
|
||||
'şc' => '200',
|
||||
'şç' => '200',
|
||||
'şd' => '200',
|
||||
'şf' => '200',
|
||||
'şg' => '200',
|
||||
'şğ' => '200',
|
||||
'şh' => '200',
|
||||
'şj' => '200',
|
||||
'şk' => '200',
|
||||
'şl' => '200',
|
||||
'şm' => '200',
|
||||
'şn' => '200',
|
||||
'şp' => '200',
|
||||
'şr' => '200',
|
||||
'şs' => '200',
|
||||
'şş' => '200',
|
||||
'şt' => '200',
|
||||
'şv' => '200',
|
||||
'şy' => '200',
|
||||
'şz' => '200',
|
||||
'tb' => '200',
|
||||
'tc' => '200',
|
||||
'tç' => '200',
|
||||
'td' => '200',
|
||||
'tf' => '200',
|
||||
'tg' => '200',
|
||||
'tğ' => '200',
|
||||
'th' => '200',
|
||||
'tj' => '200',
|
||||
'tk' => '200',
|
||||
'tl' => '200',
|
||||
'tm' => '200',
|
||||
'tn' => '200',
|
||||
'tp' => '200',
|
||||
'tr' => '200',
|
||||
'ts' => '200',
|
||||
'tş' => '200',
|
||||
'tt' => '200',
|
||||
'tv' => '200',
|
||||
'ty' => '200',
|
||||
'tz' => '200',
|
||||
'vb' => '200',
|
||||
'vc' => '200',
|
||||
'vç' => '200',
|
||||
'vd' => '200',
|
||||
'vf' => '200',
|
||||
'vg' => '200',
|
||||
'vğ' => '200',
|
||||
'vh' => '200',
|
||||
'vj' => '200',
|
||||
'vk' => '200',
|
||||
'vl' => '200',
|
||||
'vm' => '200',
|
||||
'vn' => '200',
|
||||
'vp' => '200',
|
||||
'vr' => '200',
|
||||
'vs' => '200',
|
||||
'vş' => '200',
|
||||
'vt' => '200',
|
||||
'vv' => '200',
|
||||
'vy' => '200',
|
||||
'vz' => '200',
|
||||
'yb' => '200',
|
||||
'yc' => '200',
|
||||
'yç' => '200',
|
||||
'yd' => '200',
|
||||
'yf' => '200',
|
||||
'yg' => '200',
|
||||
'yğ' => '200',
|
||||
'yh' => '200',
|
||||
'yj' => '200',
|
||||
'yk' => '200',
|
||||
'yl' => '200',
|
||||
'ym' => '200',
|
||||
'yn' => '200',
|
||||
'yp' => '200',
|
||||
'yr' => '200',
|
||||
'ys' => '200',
|
||||
'yş' => '200',
|
||||
'yt' => '200',
|
||||
'yv' => '200',
|
||||
'yy' => '200',
|
||||
'yz' => '200',
|
||||
'zb' => '200',
|
||||
'zc' => '200',
|
||||
'zç' => '200',
|
||||
'zd' => '200',
|
||||
'zf' => '200',
|
||||
'zg' => '200',
|
||||
'zğ' => '200',
|
||||
'zh' => '200',
|
||||
'zj' => '200',
|
||||
'zk' => '200',
|
||||
'zl' => '200',
|
||||
'zm' => '200',
|
||||
'zn' => '200',
|
||||
'zp' => '200',
|
||||
'zr' => '200',
|
||||
'zs' => '200',
|
||||
'zş' => '200',
|
||||
'zt' => '200',
|
||||
'zv' => '200',
|
||||
'zy' => '200',
|
||||
'zz' => '200',
|
||||
'aa' => '032',
|
||||
'aâ' => '032',
|
||||
'ae' => '032',
|
||||
'aı' => '032',
|
||||
'ai' => '032',
|
||||
'aî' => '032',
|
||||
'ao' => '032',
|
||||
'aö' => '032',
|
||||
'au' => '032',
|
||||
'aü' => '032',
|
||||
'aû' => '032',
|
||||
'âa' => '032',
|
||||
'ââ' => '032',
|
||||
'âe' => '032',
|
||||
'âı' => '032',
|
||||
'âi' => '032',
|
||||
'âî' => '032',
|
||||
'âo' => '032',
|
||||
'âö' => '032',
|
||||
'âu' => '032',
|
||||
'âü' => '032',
|
||||
'âû' => '032',
|
||||
'ea' => '032',
|
||||
'eâ' => '032',
|
||||
'ee' => '032',
|
||||
'eı' => '032',
|
||||
'ei' => '032',
|
||||
'eî' => '032',
|
||||
'eo' => '032',
|
||||
'eö' => '032',
|
||||
'eu' => '032',
|
||||
'eü' => '032',
|
||||
'eû' => '032',
|
||||
'ıa' => '032',
|
||||
'ıâ' => '032',
|
||||
'ıe' => '032',
|
||||
'ıı' => '032',
|
||||
'ıi' => '032',
|
||||
'ıî' => '032',
|
||||
'ıo' => '032',
|
||||
'ıö' => '032',
|
||||
'ıu' => '032',
|
||||
'ıü' => '032',
|
||||
'ıû' => '032',
|
||||
'ia' => '032',
|
||||
'iâ' => '032',
|
||||
'ie' => '032',
|
||||
'iı' => '032',
|
||||
'ii' => '032',
|
||||
'iî' => '032',
|
||||
'io' => '032',
|
||||
'iö' => '032',
|
||||
'iu' => '032',
|
||||
'iü' => '032',
|
||||
'iû' => '032',
|
||||
'îa' => '032',
|
||||
'îâ' => '032',
|
||||
'îe' => '032',
|
||||
'îı' => '032',
|
||||
'îi' => '032',
|
||||
'îî' => '032',
|
||||
'îo' => '032',
|
||||
'îö' => '032',
|
||||
'îu' => '032',
|
||||
'îü' => '032',
|
||||
'îû' => '032',
|
||||
'oa' => '032',
|
||||
'oâ' => '032',
|
||||
'oe' => '032',
|
||||
'oı' => '032',
|
||||
'oi' => '032',
|
||||
'oî' => '032',
|
||||
'oo' => '032',
|
||||
'oö' => '032',
|
||||
'ou' => '032',
|
||||
'oü' => '032',
|
||||
'oû' => '032',
|
||||
'öa' => '032',
|
||||
'öâ' => '032',
|
||||
'öe' => '032',
|
||||
'öı' => '032',
|
||||
'öi' => '032',
|
||||
'öî' => '032',
|
||||
'öo' => '032',
|
||||
'öö' => '032',
|
||||
'öu' => '032',
|
||||
'öü' => '032',
|
||||
'öû' => '032',
|
||||
'ua' => '032',
|
||||
'uâ' => '032',
|
||||
'ue' => '032',
|
||||
'uı' => '032',
|
||||
'ui' => '032',
|
||||
'uî' => '032',
|
||||
'uo' => '032',
|
||||
'uö' => '032',
|
||||
'uu' => '032',
|
||||
'uü' => '032',
|
||||
'uû' => '032',
|
||||
'üa' => '032',
|
||||
'üâ' => '032',
|
||||
'üe' => '032',
|
||||
'üı' => '032',
|
||||
'üi' => '032',
|
||||
'üî' => '032',
|
||||
'üo' => '032',
|
||||
'üö' => '032',
|
||||
'üu' => '032',
|
||||
'üü' => '032',
|
||||
'üû' => '032',
|
||||
'ûa' => '032',
|
||||
'ûâ' => '032',
|
||||
'ûe' => '032',
|
||||
'ûı' => '032',
|
||||
'ûi' => '032',
|
||||
'ûî' => '032',
|
||||
'ûo' => '032',
|
||||
'ûö' => '032',
|
||||
'ûu' => '032',
|
||||
'ûü' => '032',
|
||||
'ûû' => '032',
|
||||
'turk' => '00440',
|
||||
'mtrak' => '014000',
|
||||
),
|
||||
);
|
||||
|
||||
4443
site/OFF_plugins/typography/php-typography/lang/uk.php
Normal file
4443
site/OFF_plugins/typography/php-typography/lang/uk.php
Normal file
File diff suppressed because it is too large
Load diff
312
site/OFF_plugins/typography/php-typography/lang/zh-Latn.php
Normal file
312
site/OFF_plugins/typography/php-typography/lang/zh-Latn.php
Normal file
|
|
@ -0,0 +1,312 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Project: wp-Typography
|
||||
Project URI: https://code.mundschenk.at/wp-typography/
|
||||
|
||||
File modified to place pattern and exceptions in arrays that can be understood in php files.
|
||||
This file is released under the same copyright as the below referenced original file
|
||||
Original unmodified file is available at: http://ctan.mirrorcatalogs.com/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/
|
||||
Original file name: hyph-zh-latn-pinyin.tex
|
||||
|
||||
//============================================================================================================
|
||||
ORIGINAL FILE INFO
|
||||
|
||||
% This file is part of hyph-utf8 package and resulted from
|
||||
% semi-manual conversions of hyphenation patterns into UTF-8 in June 2008.
|
||||
%
|
||||
% Source: pyhyph.tex (yyyy-mm-dd)
|
||||
% Author: Werner Lemberg <wl at gnu.org>
|
||||
%
|
||||
% The above mentioned file should become obsolete,
|
||||
% and the author of the original file should preferably modify this file instead.
|
||||
%
|
||||
% Modifications were needed in order to support native UTF-8 engines,
|
||||
% but functionality (hopefully) didn't change in any way, at least not intentionally.
|
||||
% This file is no longer stand-alone; at least for 8-bit engines
|
||||
% you probably want to use loadhyph-foo.tex (which will load this file) instead.
|
||||
%
|
||||
% Modifications were done by Jonathan Kew, Mojca Miklavec & Arthur Reutenauer
|
||||
% with help & support from:
|
||||
% - Karl Berry, who gave us free hands and all resources
|
||||
% - Taco Hoekwater, with useful macros
|
||||
% - Hans Hagen, who did the unicodification of patterns already long before
|
||||
% and helped with testing, suggestions and bug reports
|
||||
% - Norbert Preining, who tested & integrated patterns into TeX Live
|
||||
%
|
||||
% However, the "copyright/copyleft" owner of patterns remains the original author.
|
||||
%
|
||||
% The copyright statement of this file is thus:
|
||||
%
|
||||
% Do with this file whatever needs to be done in future for the sake of
|
||||
% "a better world" as long as you respect the copyright of original file.
|
||||
% If you're the original author of patterns or taking over a new revolution,
|
||||
% plese remove all of the TUG comments & credits that we added here -
|
||||
% you are the Queen / the King, we are only the servants.
|
||||
%
|
||||
% If you want to change this file, rather than uploading directly to CTAN,
|
||||
% we would be grateful if you could send it to us (http://tug.org/tex-hyphen)
|
||||
% or ask for credentials for SVN repository and commit it yourself;
|
||||
% we will then upload the whole "package" to CTAN.
|
||||
%
|
||||
% Before a new "pattern-revolution" starts,
|
||||
% please try to follow some guidelines if possible:
|
||||
%
|
||||
% - \lccode is *forbidden*, and I really mean it
|
||||
% - all the patterns should be in UTF-8
|
||||
% - the only "allowed" TeX commands in this file are: \patterns, \hyphenation,
|
||||
% and if you really cannot do without, also \input and \message
|
||||
% - in particular, please no \catcode or \lccode changes,
|
||||
% they belong to loadhyph-foo.tex,
|
||||
% and no \lefthyphenmin and \righthyphenmin,
|
||||
% they have no influence here and belong elsewhere
|
||||
% - \begingroup and/or \endinput is not needed
|
||||
% - feel free to do whatever you want inside comments
|
||||
%
|
||||
% We know that TeX is extremely powerful, but give a stupid parser
|
||||
% at least a chance to read your patterns.
|
||||
%
|
||||
% For more unformation see
|
||||
%
|
||||
% http://tug.org/tex-hyphen
|
||||
%
|
||||
%------------------------------------------------------------------------------
|
||||
%
|
||||
% This is the file pyhyph.tex of the CJK package
|
||||
% for hyphenating Chinese pinyin syllables.
|
||||
%
|
||||
% created by Werner Lemberg <wl@gnu.org>
|
||||
%
|
||||
% Version 4.8.0 (22-May-2008)
|
||||
%
|
||||
% Copyright (C) 1994-2008 Werner Lemberg <wl@gnu.org>
|
||||
%
|
||||
% This program is free software; you can redistribute it and/or modify
|
||||
% it under the terms of the GNU General Public License as published by
|
||||
% the Free Software Foundation; either version 2 of the License, or
|
||||
% (at your option) any later version.
|
||||
%
|
||||
% This program is distributed in the hope that it will be useful,
|
||||
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
% GNU General Public License for more details.
|
||||
%
|
||||
% You should have received a copy of the GNU General Public License
|
||||
% along with this program in doc/COPYING; if not, write to the Free
|
||||
% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
% MA 02110-1301 USA
|
||||
%
|
||||
% \message{Hyphenation patterns for unaccented pinyin syllables (CJK 4.7.0)}
|
||||
%
|
||||
|
||||
|
||||
//============================================================================================================
|
||||
|
||||
*/
|
||||
|
||||
$patgenLanguage = 'Chinese pinyin (Latin)';
|
||||
|
||||
$patgenExceptions = array();
|
||||
|
||||
$patgenMaxSeg = 2;
|
||||
|
||||
$patgen = array(
|
||||
'begin' => array( ),
|
||||
|
||||
'end' => array( ),
|
||||
|
||||
'all' => array(
|
||||
'ab' => '010',
|
||||
'ac' => '010',
|
||||
'ad' => '010',
|
||||
'af' => '010',
|
||||
'ag' => '010',
|
||||
'ah' => '010',
|
||||
'aj' => '010',
|
||||
'ak' => '010',
|
||||
'al' => '010',
|
||||
'am' => '010',
|
||||
'ap' => '010',
|
||||
'aq' => '010',
|
||||
'ar' => '010',
|
||||
'as' => '010',
|
||||
'at' => '010',
|
||||
'aw' => '010',
|
||||
'ax' => '010',
|
||||
'ay' => '010',
|
||||
'az' => '010',
|
||||
'eb' => '010',
|
||||
'ec' => '010',
|
||||
'ed' => '010',
|
||||
'ef' => '010',
|
||||
'eg' => '010',
|
||||
'eh' => '010',
|
||||
'ej' => '010',
|
||||
'ek' => '010',
|
||||
'el' => '010',
|
||||
'em' => '010',
|
||||
'ep' => '010',
|
||||
'eq' => '010',
|
||||
'es' => '010',
|
||||
'et' => '010',
|
||||
'ew' => '010',
|
||||
'ex' => '010',
|
||||
'ey' => '010',
|
||||
'ez' => '010',
|
||||
'ga' => '100',
|
||||
'gb' => '010',
|
||||
'gc' => '010',
|
||||
'gd' => '010',
|
||||
'ge' => '100',
|
||||
'gf' => '010',
|
||||
'gg' => '010',
|
||||
'gh' => '010',
|
||||
'gj' => '010',
|
||||
'gk' => '010',
|
||||
'gl' => '010',
|
||||
'gm' => '010',
|
||||
'gn' => '010',
|
||||
'go' => '100',
|
||||
'gp' => '010',
|
||||
'gq' => '010',
|
||||
'gr' => '010',
|
||||
'gs' => '010',
|
||||
'gt' => '010',
|
||||
'gu' => '100',
|
||||
'gw' => '010',
|
||||
'gx' => '010',
|
||||
'gy' => '010',
|
||||
'gz' => '010',
|
||||
'ib' => '010',
|
||||
'ic' => '010',
|
||||
'id' => '010',
|
||||
'if' => '010',
|
||||
'ig' => '010',
|
||||
'ih' => '010',
|
||||
'ij' => '010',
|
||||
'ik' => '010',
|
||||
'il' => '010',
|
||||
'im' => '010',
|
||||
'ip' => '010',
|
||||
'iq' => '010',
|
||||
'ir' => '010',
|
||||
'is' => '010',
|
||||
'it' => '010',
|
||||
'iw' => '010',
|
||||
'ix' => '010',
|
||||
'iy' => '010',
|
||||
'iz' => '010',
|
||||
'na' => '100',
|
||||
'nb' => '010',
|
||||
'nc' => '010',
|
||||
'nd' => '010',
|
||||
'ne' => '100',
|
||||
'nf' => '010',
|
||||
'nh' => '010',
|
||||
'ni' => '100',
|
||||
'nj' => '010',
|
||||
'nk' => '010',
|
||||
'nl' => '010',
|
||||
'nm' => '010',
|
||||
'nn' => '010',
|
||||
'no' => '100',
|
||||
'np' => '010',
|
||||
'nq' => '010',
|
||||
'nr' => '010',
|
||||
'ns' => '010',
|
||||
'nt' => '010',
|
||||
'nu' => '100',
|
||||
'nü' => '100',
|
||||
'nw' => '010',
|
||||
'nx' => '010',
|
||||
'ny' => '010',
|
||||
'nz' => '010',
|
||||
'ob' => '010',
|
||||
'oc' => '010',
|
||||
'od' => '010',
|
||||
'of' => '010',
|
||||
'og' => '010',
|
||||
'oh' => '010',
|
||||
'oj' => '010',
|
||||
'ok' => '010',
|
||||
'ol' => '010',
|
||||
'om' => '010',
|
||||
'op' => '010',
|
||||
'oq' => '010',
|
||||
'or' => '010',
|
||||
'os' => '010',
|
||||
'ot' => '010',
|
||||
'ow' => '010',
|
||||
'ox' => '010',
|
||||
'oy' => '010',
|
||||
'oz' => '010',
|
||||
'ra' => '100',
|
||||
'rb' => '010',
|
||||
'rc' => '010',
|
||||
'rd' => '010',
|
||||
're' => '100',
|
||||
'rf' => '010',
|
||||
'rg' => '010',
|
||||
'rh' => '010',
|
||||
'ri' => '100',
|
||||
'rj' => '010',
|
||||
'rk' => '010',
|
||||
'rl' => '010',
|
||||
'rm' => '010',
|
||||
'rn' => '010',
|
||||
'ro' => '100',
|
||||
'rp' => '010',
|
||||
'rq' => '010',
|
||||
'rr' => '010',
|
||||
'rs' => '010',
|
||||
'rt' => '010',
|
||||
'ru' => '100',
|
||||
'rw' => '010',
|
||||
'rx' => '010',
|
||||
'ry' => '010',
|
||||
'rz' => '010',
|
||||
'ub' => '010',
|
||||
'uc' => '010',
|
||||
'ud' => '010',
|
||||
'uf' => '010',
|
||||
'ug' => '010',
|
||||
'uh' => '010',
|
||||
'uj' => '010',
|
||||
'uk' => '010',
|
||||
'ul' => '010',
|
||||
'um' => '010',
|
||||
'up' => '010',
|
||||
'uq' => '010',
|
||||
'ur' => '010',
|
||||
'us' => '010',
|
||||
'ut' => '010',
|
||||
'uw' => '010',
|
||||
'ux' => '010',
|
||||
'uy' => '010',
|
||||
'uz' => '010',
|
||||
'üb' => '010',
|
||||
'üc' => '010',
|
||||
'üd' => '010',
|
||||
'üf' => '010',
|
||||
'üg' => '010',
|
||||
'üh' => '010',
|
||||
'üj' => '010',
|
||||
'ük' => '010',
|
||||
'ül' => '010',
|
||||
'üm' => '010',
|
||||
'ün' => '010',
|
||||
'üp' => '010',
|
||||
'üq' => '010',
|
||||
'ür' => '010',
|
||||
'üs' => '010',
|
||||
'üt' => '010',
|
||||
'üw' => '010',
|
||||
'üx' => '010',
|
||||
'üy' => '010',
|
||||
'üz' => '010',
|
||||
'\'a' => '010',
|
||||
'\'e' => '010',
|
||||
'\'o' => '010',
|
||||
),
|
||||
);
|
||||
|
||||
|
|
@ -0,0 +1,366 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of wp-Typography.
|
||||
*
|
||||
* Copyright 2015 Peter Putzer.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package wpTypography/PHPTypography/Converter
|
||||
* @author Peter Putzer <github@mundschenk.at>
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
namespace PHP_Typography;
|
||||
|
||||
define( 'WP_TYPOGRAPHY_DEBUG', true );
|
||||
|
||||
require_once( dirname( __DIR__ ) . '/php-typography-functions.php' );
|
||||
|
||||
class Pattern_Converter {
|
||||
|
||||
private $url;
|
||||
private $language;
|
||||
private $quote;
|
||||
private $word_characters;
|
||||
private $escape_list;
|
||||
|
||||
/**
|
||||
* Retrieve patgen segment from TeX hyphenation pattern.
|
||||
*
|
||||
* @param string $pattern
|
||||
* @return string
|
||||
*/
|
||||
function get_segment( $pattern ) {
|
||||
return preg_replace( '/[0-9]/', '', str_replace( '.', '', $pattern ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate patgen sequence from TeX hyphenation pattern.
|
||||
*
|
||||
* @param string $pattern
|
||||
* @return string
|
||||
*/
|
||||
function get_sequence( $pattern ) {
|
||||
$characters = mb_str_split( str_replace( '.', '', $pattern ) );
|
||||
$result = array();
|
||||
|
||||
foreach ( $characters as $index => $chr ) {
|
||||
if ( ctype_digit( $chr ) ) {
|
||||
$result[] = $chr;
|
||||
} else {
|
||||
if ( ! isset( $characters[ $index - 1 ] ) || ! ctype_digit( $characters[ $index - 1 ] ) ) {
|
||||
$result[] = '0';
|
||||
}
|
||||
|
||||
if ( ! isset( $characters[ $index + 1 ] ) && ! ctype_digit( $characters[ $index ] ) ) {
|
||||
$result[] = '0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// error checking
|
||||
$count = count( $result );
|
||||
$count_seg = mb_strlen( $this->get_segment( $pattern ) );
|
||||
$sequence = implode( $result );
|
||||
|
||||
if ( $count !== $count_seg + 1 ) {
|
||||
error_log("Invalid segment length $count for pattern $pattern (result sequence $sequence)" );
|
||||
|
||||
die( -3000 );
|
||||
}
|
||||
|
||||
return $sequence;
|
||||
}
|
||||
|
||||
/**
|
||||
* Echo hyphenation pattern file for wp-Typography.
|
||||
*
|
||||
* @param array $patterns
|
||||
* @param array $exceptions
|
||||
* @param array $comments
|
||||
* @param string $language
|
||||
*/
|
||||
function write_results( array $patterns, array $exceptions, array $comments ) {
|
||||
$begin_patterns = array();
|
||||
$end_patterns = array();
|
||||
$all_patterns = array();
|
||||
|
||||
foreach ( $patterns as $pattern ) {
|
||||
if ( preg_match( '/^\.(.+)$/', $pattern, $matches ) ) {
|
||||
$segment = $this->get_segment( $matches[1] );
|
||||
if ( ! isset( $begin_patterns[ $segment ] ) ) {
|
||||
$begin_patterns[ $segment ] = $this->get_sequence( $matches[1] );
|
||||
}
|
||||
} elseif ( preg_match( '/^(.+)\.$/', $pattern, $matches ) ) {
|
||||
$segment = $this->get_segment( $matches[1] );
|
||||
if ( ! isset( $end_patterns[ $segment ] ) ) {
|
||||
$end_patterns[ $segment ] = $this->get_sequence( $matches[1] );
|
||||
}
|
||||
} else {
|
||||
$segment = $this->get_segment( $pattern );
|
||||
if ( ! isset( $all_patterns[ $segment ] ) ) {
|
||||
$all_patterns[ $segment ] = $this->get_sequence( $pattern );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "<?php \n\n";
|
||||
?>
|
||||
/*
|
||||
Project: wp-Typography
|
||||
Project URI: https://code.mundschenk.at/wp-typography/
|
||||
|
||||
File modified to place pattern and exceptions in arrays that can be understood in php files.
|
||||
This file is released under the same copyright as the below referenced original file
|
||||
Original unmodified file is available at: <?= dirname( $this->url ) . "/\n" ?>
|
||||
Original file name: <?= basename( $this->url ) . "\n" ?>
|
||||
|
||||
//============================================================================================================
|
||||
ORIGINAL FILE INFO
|
||||
|
||||
<?php
|
||||
foreach ( $comments as $comment ) {
|
||||
echo "\t\t" . $comment;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
//============================================================================================================
|
||||
|
||||
*/
|
||||
|
||||
$patgenLanguage = <?= $this->quote . $this->language . $this->quote ?>;
|
||||
|
||||
$patgenExceptions = array(<?php if ( count( $exceptions ) > 0 ) echo "\n";
|
||||
|
||||
foreach ( $exceptions as $exception ) {
|
||||
echo "\t{$this->quote}" . mb_strtolower( str_replace( '-', '', $exception ) ) . "{$this->quote}\t=>\t{$this->quote}" . mb_strtolower( $exception ) . "{$this->quote},\n";
|
||||
}
|
||||
?>
|
||||
);
|
||||
|
||||
$patgenMaxSeg = <?= max( array_map( 'mb_strlen', array_map( array( $this, 'get_segment' ), $patterns ) ) ) ?>;
|
||||
|
||||
$patgen = array(
|
||||
<?= $this->quote ?>begin<?= $this->quote ?> => array(<?php if ( count( $begin_patterns ) > 0 ) echo "\n";
|
||||
|
||||
foreach ( $begin_patterns as $key => $pat ) {
|
||||
echo "\t\t{$this->quote}" . addcslashes( $key, $this->escape_list ) . "{$this->quote}\t=>\t{$this->quote}" . $pat. "{$this->quote},\n";
|
||||
}
|
||||
|
||||
?>
|
||||
),
|
||||
|
||||
<?= $this->quote ?>end<?= $this->quote ?> => array(<?php if ( count( $end_patterns ) > 0 ) echo "\n";
|
||||
|
||||
foreach ( $end_patterns as $key => $pat ) {
|
||||
echo "\t\t{$this->quote}" . addcslashes( $key, $this->escape_list ) . "{$this->quote}\t=>\t{$this->quote}" . $pat . "{$this->quote},\n";
|
||||
}
|
||||
?>
|
||||
),
|
||||
|
||||
<?= $this->quote ?>all<?= $this->quote ?> => array(<?php if ( count( $all_patterns ) > 0 ) echo "\n";
|
||||
|
||||
foreach ( $all_patterns as $key => $pat ) {
|
||||
echo "\t\t{$this->quote}" . addcslashes( $key, $this->escape_list ) . "{$this->quote}\t=>\t{$this->quote}" . $pat. "{$this->quote},\n";
|
||||
}
|
||||
?>
|
||||
),
|
||||
);
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
function __construct( $url, $language, $quote = '"' ) {
|
||||
$this->url = $url;
|
||||
$this->language = $language;
|
||||
$this->quote = $quote;
|
||||
|
||||
if ( "'" === $quote ) {
|
||||
$this->escape_list = "'\\";
|
||||
} else {
|
||||
$this->escape_list = '"\\';
|
||||
}
|
||||
|
||||
$this->word_characters = "\w.'ʼ᾽ʼ᾿’" .
|
||||
uchr( 8205, 8204, 768, 769, 771, 772, 775, 776, 784, 803, 805, 814, 817 ) .
|
||||
"\p{Devanagari}" . uchr( 2385, 2386 ) .
|
||||
"\p{Bengali}" .
|
||||
"\p{Gujarati}" .
|
||||
"\p{Kannada}" .
|
||||
"\p{Telugu}" .
|
||||
"\p{Malayalam}" .
|
||||
"\p{Thai}" .
|
||||
"-";
|
||||
// 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2402 ) .
|
||||
}
|
||||
|
||||
function match_exceptions( $line, array &$exceptions ) {
|
||||
if ( preg_match( '/^\s*([\w-]+)\s*}\s*(?:%.*)?$/u', $line, $matches ) ) {
|
||||
$exceptions[] = $matches[1];
|
||||
return false;
|
||||
} if ( preg_match( '/^\s*((?:[\w-]+\s*)+)\s*}\s*(?:%.*)?$/u', $line, $matches ) ) {
|
||||
$this->match_exceptions( $matches[1], $exceptions );
|
||||
return false;
|
||||
} elseif ( preg_match( '/^\s*}\s*(?:%.*)?$/u', $line, $matches ) ) {
|
||||
return false;
|
||||
} elseif ( preg_match( '/^\s*([\w-]+)\s*(?:%.*)?$/u', $line, $matches ) ) {
|
||||
$exceptions[] = $matches[1];
|
||||
} elseif ( preg_match( '/^\s*((?:[\w-]+\s*)+)(?:%.*)?$/u', $line, $matches ) ) {
|
||||
// sometimes there are multiple exceptions on a single line
|
||||
foreach ( preg_split( '/\s+/u', $matches[1], -1, PREG_SPLIT_NO_EMPTY ) as $match ) {
|
||||
$exceptions[] = $match;
|
||||
}
|
||||
} elseif ( preg_match( '/^\s*(?:%.*)?$/u', $line, $matches ) ) {
|
||||
// ignore comments and whitespace in exceptions
|
||||
} else {
|
||||
echo "Error: unknown exception line $line\n";
|
||||
die(-1000);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function match_patterns( $line, array &$patterns ) {
|
||||
if ( preg_match( '/^\s*([' . $this->word_characters . ']+)\s*}\s*(?:%.*)?$/u', $line, $matches ) ) {
|
||||
$patterns[] = $matches[1];
|
||||
return false;
|
||||
} elseif ( preg_match( '/^\s*}\s*(?:%.*)?$/u', $line, $matches ) ) {
|
||||
return false;
|
||||
} elseif ( preg_match( '/^\s*([' . $this->word_characters . ']+)\s*(?:%.*)?$/u', $line, $matches ) ) {
|
||||
$patterns[] = $matches[1];
|
||||
} elseif ( preg_match( '/^\s*((?:[' . $this->word_characters . ']+\s*)+)(?:%.*)?$/u', $line, $matches ) ) {
|
||||
// sometimes there are multiple patterns on a single line
|
||||
foreach ( preg_split( '/\s+/u', $matches[1], -1, PREG_SPLIT_NO_EMPTY ) as $match ) {
|
||||
$patterns[] = $match;
|
||||
}
|
||||
} elseif ( preg_match( '/^\s*(?:%.*)?$/u', $line, $matches ) ) {
|
||||
// ignore comments and whitespace in patterns
|
||||
} else {
|
||||
echo "Error: unknown pattern line " . clean_html( $line ) . "\n";
|
||||
die(-1000);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the given TeX file.
|
||||
*/
|
||||
function convert() {
|
||||
if ( ! file_exists( $this->url ) ) {
|
||||
$file_headers = @get_headers( $this->url );
|
||||
if ( $file_headers[0] === 'HTTP/1.0 404 Not Found' ) {
|
||||
echo "Error: unknown pattern file '{$this->url}'\n";
|
||||
die(-3);
|
||||
}
|
||||
}
|
||||
|
||||
// results
|
||||
$comments = array();
|
||||
$patterns = array();
|
||||
$exceptions = array();
|
||||
|
||||
// status indicators
|
||||
$reading_patterns = false;
|
||||
$reading_exceptions = false;
|
||||
|
||||
$file = new \SplFileObject( $this->url );
|
||||
while ( ! $file->eof() ) {
|
||||
$line = $file->fgets();
|
||||
|
||||
if ( $reading_patterns ) {
|
||||
$reading_patterns = $this->match_patterns( $line, $patterns );
|
||||
} elseif ( $reading_exceptions ) {
|
||||
$reading_exceptions = $this->match_exceptions( $line, $exceptions );
|
||||
} else {
|
||||
// something else
|
||||
if ( preg_match( '/^\s*%.*$/u', $line, $matches ) ) {
|
||||
$comments[] = $line;
|
||||
} elseif ( preg_match( '/^\s*\\\patterns\s*\{\s*(.*)$/u', $line, $matches ) ) {
|
||||
$reading_patterns = $this->match_patterns( $matches[1], $patterns );
|
||||
} elseif ( preg_match( '/^\s*\\\hyphenation\s*{\s*(.*)$/u', $line, $matches ) ) {
|
||||
$reading_exceptions = $this->match_exceptions( $matches[1], $exceptions );
|
||||
} elseif ( preg_match( '/^\s*\\\endinput.*$/u', $line, $matches ) ) {
|
||||
// ignore this line completely
|
||||
} elseif ( preg_match( '/^\s*\\\[\w]+.*$/u', $line, $matches ) ) {
|
||||
// treat other commands as comments unless we are matching exceptions or patterns
|
||||
$comments[] = $line;
|
||||
} elseif ( preg_match( '/^\s*$/u', $line, $matches ) ) {
|
||||
// do nothing
|
||||
} else {
|
||||
echo "Error: unknown line $line\n";
|
||||
die(-1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->write_results( $patterns, $exceptions, $comments );
|
||||
}
|
||||
}
|
||||
|
||||
$shortopts = "l:f:hvs";
|
||||
$longopts = array( "lang:", "file:", "help", "version", "single-quotes" );
|
||||
|
||||
$options = getopt( $shortopts, $longopts );
|
||||
|
||||
// print version
|
||||
if ( isset( $options['v'] ) || isset( $options['version'] ) ) {
|
||||
echo "wp-Typography hyhpenationa pattern converter 1.0-alpha\n\n";
|
||||
die( 0 );
|
||||
}
|
||||
|
||||
// print help
|
||||
if ( isset( $options['h'] ) || isset( $options['help'] ) ) {
|
||||
echo "Usage: convert_pattern [arguments]\n";
|
||||
echo "convert_pattern -l <language> -f <filename>\t\tconvert <filename> -s\n";
|
||||
echo "convert_pattern --lang <language> --file <filename>\tconvert <filename> --single-quotes\n";
|
||||
echo "convert_pattern -v|--version\t\t\t\tprint version\n";
|
||||
echo "convert_pattern -h|--help\t\t\t\tprint help\n";
|
||||
die( 0 );
|
||||
}
|
||||
|
||||
// read necessary options
|
||||
if ( isset( $options['f'] ) ) {
|
||||
$filename = $options['f'];
|
||||
} elseif ( isset( $options['file'] ) ) {
|
||||
$filename = $options['file'];
|
||||
}
|
||||
if ( empty( $filename ) ) {
|
||||
echo "Error: no filename\n";
|
||||
die( -1 );
|
||||
}
|
||||
|
||||
if ( isset( $options['l'] ) ) {
|
||||
$language = $options['l'];
|
||||
} elseif ( isset( $options['lang'] ) ) {
|
||||
$language = $options['lang'];
|
||||
}
|
||||
if ( empty( $language ) ) {
|
||||
echo "Error: no language\n";
|
||||
die( -2 );
|
||||
}
|
||||
|
||||
$quote = '"';
|
||||
if ( isset( $options['s'] ) || isset( $options['single-quote'] ) ) {
|
||||
$quote = "'";
|
||||
}
|
||||
|
||||
$converter = new Pattern_Converter( $filename, $language, $quote );
|
||||
$converter->convert();
|
||||
|
|
@ -0,0 +1,252 @@
|
|||
% This file is part of hyph-utf8 package and resulted from
|
||||
% semi-manual conversions of hyphenation patterns into UTF-8 in June 2008.
|
||||
%
|
||||
% Source: lahyph.tex (2007-09-03)
|
||||
% Author: Claudio Beccari <claudio.beccari at polito.it>
|
||||
%
|
||||
% The above mentioned file should become obsolete,
|
||||
% and the author of the original file should preferaby modify this file instead.
|
||||
%
|
||||
% Modificatios were needed in order to support native UTF-8 engines,
|
||||
% but functionality (hopefully) didn't change in any way, at least not intentionally.
|
||||
% This file is no longer stand-alone; at least for 8-bit engines
|
||||
% you probably want to use loadhyph-foo.tex (which will load this file) instead.
|
||||
%
|
||||
% Modifications were done by Jonathan Kew, Mojca Miklavec & Arthur Reutenauer
|
||||
% with help & support from:
|
||||
% - Karl Berry, who gave us free hands and all resources
|
||||
% - Taco Hoekwater, with useful macros
|
||||
% - Hans Hagen, who did the unicodifisation of patterns already long before
|
||||
% and helped with testing, suggestions and bug reports
|
||||
% - Norbert Preining, who tested & integrated patterns into TeX Live
|
||||
%
|
||||
% However, the "copyright/copyleft" owner of patterns remains the original author.
|
||||
%
|
||||
% The copyright statement of this file is thus:
|
||||
%
|
||||
% Do with this file whatever needs to be done in future for the sake of
|
||||
% "a better world" as long as you respect the copyright of original file.
|
||||
% If you're the original author of patterns or taking over a new revolution,
|
||||
% plese remove all of the TUG comments & credits that we added here -
|
||||
% you are the Queen / the King, we are only the servants.
|
||||
%
|
||||
% If you want to change this file, rather than uploading directly to CTAN,
|
||||
% we would be grateful if you could send it to us (http://tug.org/tex-hyphen)
|
||||
% or ask for credentials for SVN repository and commit it yourself;
|
||||
% we will then upload the whole "package" to CTAN.
|
||||
%
|
||||
% Before a new "pattern-revolution" starts,
|
||||
% please try to follow some guidelines if possible:
|
||||
%
|
||||
% - \lccode is *forbidden*, and I really mean it
|
||||
% - all the patterns should be in UTF-8
|
||||
% - the only "allowed" TeX commands in this file are: \patterns, \hyphenation,
|
||||
% and if you really cannot do without, also \input and \message
|
||||
% - in particular, please no \catcode or \lccode changes,
|
||||
% they belong to loadhyph-foo.tex,
|
||||
% and no \lefthyphenmin and \righthyphenmin,
|
||||
% they have no influence here and belong elsewhere
|
||||
% - \begingroup and/or \endinput is not needed
|
||||
% - feel free to do whatever you want inside comments
|
||||
%
|
||||
% We know that TeX is extremely powerful, but give a stupid parser
|
||||
% at least a chance to read your patterns.
|
||||
%
|
||||
% For more unformation see
|
||||
%
|
||||
% http://tug.org/tex-hyphen
|
||||
%
|
||||
%------------------------------------------------------------------------------
|
||||
%
|
||||
% ********** lahyph.tex *************
|
||||
%
|
||||
% Copyright 1999- 2001 Claudio Beccari
|
||||
% [latin hyphenation patterns]
|
||||
%
|
||||
% -----------------------------------------------------------------
|
||||
% IMPORTANT NOTICE:
|
||||
%
|
||||
% This program can be redistributed and/or modified under the terms
|
||||
% of the LaTeX Project Public License Distributed from CTAN
|
||||
% archives in directory macros/latex/base/lppl.txt; either
|
||||
% version 1 of the License, or any later version.
|
||||
% -----------------------------------------------------------------
|
||||
%
|
||||
% Patterns for the latin language mainly in modern spelling
|
||||
% (u when u is needed and v when v is needed); medieval spelling
|
||||
% with the ligatures \ae and \oe and the (uncial) lowercase `v'
|
||||
% written as a `u' is also supported; apparently there is no conflict
|
||||
% between the patterns of modern Latin and those of medieval Latin.
|
||||
%
|
||||
% Support for font encoding OT1 with 128-character set and
|
||||
% for font encoding T1 with a 256-character set.
|
||||
%
|
||||
% Prepared by Claudio Beccari
|
||||
% Politecnico di Torino
|
||||
% Torino, Italy
|
||||
% e-mail beccari@polito.it
|
||||
%
|
||||
% 1999/03/10 Integration of `lahyph7.tex' and `lahyph8.tex' into
|
||||
% one file `lahyph.tex' supporting fonts in OT1 and T1 encoding by
|
||||
% Bernd Raichle using the macro code from `dehypht.tex' (this code
|
||||
% is Copyright 1993,1994,1998,1999 Bernd Raichle/DANTE e.V.).
|
||||
%
|
||||
%
|
||||
% \versionnumber{3.1} \versiondate{2007/04/16}
|
||||
%
|
||||
% Information after \endinput.
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
% \message{Latin Hyphenation Patterns `lahyph' Version 3.1 <2007/04/16>}
|
||||
%
|
||||
%
|
||||
\patterns{%
|
||||
2'2
|
||||
.a2b3l
|
||||
.anti1 .anti3m2n
|
||||
.circu2m1
|
||||
.co2n1iun
|
||||
.di2s3cine
|
||||
.e2x1
|
||||
.o2b3
|
||||
.para1i .para1u
|
||||
.su2b3lu .su2b3r
|
||||
2s3que. 2s3dem.
|
||||
3p2sic
|
||||
3p2neu
|
||||
æ1 œ1
|
||||
a1ia a1ie a1io a1iu ae1a ae1o ae1u
|
||||
e1iu
|
||||
io1i
|
||||
o1ia o1ie o1io o1iu
|
||||
uo3u
|
||||
1b 2bb 2bd b2l 2bm 2bn b2r 2bt 2bs 2b.
|
||||
1c 2cc c2h2 c2l 2cm 2cn 2cq c2r 2cs 2ct 2cz 2c.
|
||||
1d 2dd 2dg 2dm d2r 2ds 2dv 2d.
|
||||
1f 2ff f2l 2fn f2r 2ft 2f.
|
||||
1g 2gg 2gd 2gf g2l 2gm g2n g2r 2gs 2gv 2g.
|
||||
1h 2hp 2ht 2h.
|
||||
1j
|
||||
1k 2kk k2h2
|
||||
1l 2lb 2lc 2ld 2lf l3f2t 2lg 2lk 2ll 2lm 2ln 2lp 2lq 2lr
|
||||
2ls 2lt 2lv 2l.
|
||||
1m 2mm 2mb 2mp 2ml 2mn 2mq 2mr 2mv 2m.
|
||||
1n 2nb 2nc 2nd 2nf 2ng 2nl 2nm 2nn 2np 2nq 2nr 2ns
|
||||
n2s3m n2s3f 2nt 2nv 2nx 2n.
|
||||
1p p2h p2l 2pn 2pp p2r 2ps 2pt 2pz 2php 2pht 2p.
|
||||
1qu2
|
||||
1r 2rb 2rc 2rd 2rf 2rg r2h 2rl 2rm 2rn 2rp 2rq 2rr 2rs 2rt
|
||||
2rv 2rz 2r.
|
||||
1s2 2s3ph 2s3s 2stb 2stc 2std 2stf 2stg 2st3l 2stm 2stn 2stp 2stq
|
||||
2sts 2stt 2stv 2s. 2st.
|
||||
1t 2tb 2tc 2td 2tf 2tg t2h t2l t2r 2tm 2tn 2tp 2tq 2tt
|
||||
2tv 2t.
|
||||
1v v2l v2r 2vv
|
||||
1x 2xt 2xx 2x.
|
||||
1z 2z.
|
||||
% For medieval Latin
|
||||
a1ua a1ue a1ui a1uo a1uu
|
||||
e1ua e1ue e1ui e1uo e1uu
|
||||
i1ua i1ue i1ui i1uo i1uu
|
||||
o1ua o1ue o1ui o1uo o1uu
|
||||
u1ua u1ue u1ui u1uo u1uu
|
||||
%
|
||||
a2l1ua a2l1ue a2l1ui a2l1uo a2l1uu
|
||||
e2l1ua e2l1ue e2l1ui e2l1uo e2l1uu
|
||||
i2l1ua i2l1ue i2l1ui i2l1uo i2l1uu
|
||||
o2l1ua o2l1ue o2l1ui o2l1uo o2l1uu
|
||||
u2l1ua u2l1ue u2l1ui u2l1uo u2l1uu
|
||||
%
|
||||
a2m1ua a2m1ue a2m1ui a2m1uo a2m1uu
|
||||
e2m1ua e2m1ue e2m1ui e2m1uo e2m1uu
|
||||
i2m1ua i2m1ue i2m1ui i2m1uo i2m1uu
|
||||
o2m1ua o2m1ue o2m1ui o2m1uo o2m1uu
|
||||
u2m1ua u2m1ue u2m1ui u2m1uo u2m1uu
|
||||
%
|
||||
a2n1ua a2n1ue a2n1ui a2n1uo a2n1uu
|
||||
e2n1ua e2n1ue e2n1ui e2n1uo e2n1uu
|
||||
i2n1ua i2n1ue i2n1ui i2n1uo i2n1uu
|
||||
o2n1ua o2n1ue o2n1ui o2n1uo o2n1uu
|
||||
u2n1ua u2n1ue u2n1ui u2n1uo u2n1uu
|
||||
%
|
||||
a2r1ua a2r1ue a2r1ui a2r1uo a2r1uu
|
||||
e2r1ua e2r1ue e2r1ui e2r1uo e2r1uu
|
||||
i2r1ua i2r1ue i2r1ui i2r1uo i2r1uu
|
||||
o2r1ua o2r1ue o2r1ui o2r1uo o2r1uu
|
||||
u2r1ua u2r1ue u2r1ui u2r1uo u2r1uu
|
||||
%
|
||||
%
|
||||
}
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
% For documentation see:
|
||||
% C. Beccari, "Computer aided hyphenation for Italian and Modern
|
||||
% Latin", TUG vol. 13, n. 1, pp. 23-33 (1992)
|
||||
%
|
||||
% see also
|
||||
%
|
||||
% C. Beccari, "Typesetting of ancient languages",
|
||||
% TUG vol.15, n.1, pp. 9-16 (1994)
|
||||
%
|
||||
% In the former paper the code was described as being contained in file
|
||||
% ITALAT.TEX; this is substantially the same code, but the file has been
|
||||
% renamed LAHYPH.TEX in accordance with the ISO name for Latin and the
|
||||
% convention that all hyphenation pattern file names should be formed by the
|
||||
% agglutination of two letter language ISO code and the abbreviation HYPH.
|
||||
%
|
||||
% A corresponding file (ITHYPH.TEX) has been extracted in order to eliminate
|
||||
% the (few) patterns specific to Latin and leave those specific to Italian;
|
||||
% ITHYPH.TEX has been further extended with many new patterns in order to
|
||||
% cope with the many neologisms and technical terms with foreign roots.
|
||||
%
|
||||
% Should you find any word that gets hyphenated in a wrong way, please, AFTER
|
||||
% CHECKING ON A RELIABLE MODERN DICTIONARY, report to the author, preferably
|
||||
% by e-mail. Please do not report about wrong break points concerning
|
||||
% prefixes and/or suffixes; see at the bottom of this file.
|
||||
%
|
||||
% Compared with the previous versions, this file has been extended so as to
|
||||
% cope also with the medieval Latin spelling, where the letter `V' played the
|
||||
% roles of both `U' and `V', as in the Roman times, save that the Romans used
|
||||
% only capitals. In the middle ages the availability of soft writing supports
|
||||
% and the necessity of copying books with a reasonable speed, several scripts
|
||||
% evolved in (practically) all of which there was a lower case alphabet
|
||||
% different from the upper case one, and where the lower case `v' had the
|
||||
% rounded shape of our modern lower case `u', and where the Latin diphthongs
|
||||
% `AE' and `OE', both in upper and lower case, where written as ligatures,
|
||||
% not to mention the habit of substituting them with their sound, that is a
|
||||
% simple `E'.
|
||||
%
|
||||
% According to Leon Battista Alberti, who in 1466 wrote a book on
|
||||
% cryptography where he thoroughly analyzed the hyphenation of the Latin
|
||||
% language of his (still medieval) times, the differences from the Tuscan
|
||||
% language (the Italian language, as it was named at his time) were very
|
||||
% limited, in particular for what concerns the handling of the ascending and
|
||||
% descending diphthongs; in Central and Northern Europe, and later on in
|
||||
% North America, the Scholars perceived the above diphthongs as made of two
|
||||
% distinct vowels; the hyphenation of medieval Latin, therefore, was quite
|
||||
% different in the northern countries compared to the southern ones, at least
|
||||
% for what concerns these diphthongs. If you need hyphenation patterns for
|
||||
% medieval Latin that suite you better according to the habits of Northern
|
||||
% Europe you should resort to the hyphenation patterns prepared by Yannis
|
||||
% Haralambous (TUGboat, vol.13 n.4 (1992)).
|
||||
%
|
||||
%
|
||||
%
|
||||
% PREFIXES AND SUFFIXES
|
||||
%
|
||||
% For what concerns prefixes and suffixes, the latter are generally separated
|
||||
% according to "natural" syllabification, while the former are generally
|
||||
% divided etimologically. In order to avoid an excessive number of patterns,
|
||||
% care has been paid to some prefixes, especially "ex", "trans", "circum",
|
||||
% "prae", but this set of patterns is NOT capable of separating the prefixes
|
||||
% in all circumstances.
|
||||
%
|
||||
% BABEL SHORTCUTS AND FACILITIES
|
||||
%
|
||||
% Read the documentation coming with the discription of the Latin language
|
||||
% interface of Babel in order to see the shortcuts and the facilities
|
||||
% introduced in order to facilitate the insertion of "compound word marks"
|
||||
% which are very useful for inserting etimological break points.
|
||||
%
|
||||
% Happy Latin and multilingual typesetting!
|
||||
27303
site/OFF_plugins/typography/php-typography/lang_unformatted/hyph-no.tex
Normal file
27303
site/OFF_plugins/typography/php-typography/lang_unformatted/hyph-no.tex
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
/*
|
||||
Project: PHP Typography
|
||||
Project URI: http://kingdesk.com/projects/php-typography/
|
||||
|
||||
File modified to place pattern and exceptions in arrays that can be understood in php files.
|
||||
This file is released under the same copyright as the below referenced original file
|
||||
Original unmodified file is available at: http://mirror.unl.edu/ctan/language/hyph-utf8/tex/generic/hyph-utf8/patterns/
|
||||
Original file name: hyph-_______________.tex
|
||||
|
||||
//============================================================================================================
|
||||
ORIGINAL FILE INFO
|
||||
|
||||
|
||||
|
||||
//============================================================================================================
|
||||
|
||||
*/
|
||||
|
||||
|
||||
$patgenLanguage = ""; //Common name for language
|
||||
|
||||
$patgenExceptions = array(); // list of exceptions in the form of: array('associate'=>'as-so-ciate','associates'=>'as-so-ciates')
|
||||
|
||||
$patgenMaxSeg = 3; // maximum segment length in the patterns below (NOTE: Segment Lenght, not sequence length)
|
||||
|
||||
$patgen = array('begin'=>array(),'end'=>array(),'all'=>array()); // key/values should be formatted so that the key is the relevant word segment and the value is the related patgen sequence. For example: array('begin'=>array('ach'=>'0004'),'end'=>array('ab'=>'400'),'all'=>array('aba'=>'0501'))
|
||||
|
||||
// Reformatting original TeX/patgen patterns is less than convienent, but it greatly improves PHP preformance.
|
||||
// Some additional help in formatting these files for use in the PHP Typography project:
|
||||
|
||||
// They original TEX pattern files have lists of segments formatted like this:
|
||||
// .ach4
|
||||
// 4ab.
|
||||
// a5bal
|
||||
// If a segment includes a period, it indicates that it should only be applied at the beginning or end of words (reletive to its position)
|
||||
// If a period appears before the original TeX pattern, it belongs in the 'begin' subarray of the $patgen variable
|
||||
// If a period appears after the original TeX pattern, it belongs in the 'end' subarray of the $patgen variable
|
||||
// If the original TeX pattern does not contain a period, it belongs in the 'all' subarray of the $patgen variable
|
||||
//
|
||||
// The word segement is derived from the original TeX pattern by stripping all numbers and periods. Thus:
|
||||
// .ach4 becomes ach
|
||||
// 4ab. becomes ab
|
||||
// a5ba1 becomes aba
|
||||
//
|
||||
// The patgen sequence is derived from the original TeX pattern by
|
||||
// 1) removing any period
|
||||
// 2) placing a "0" between any adjacent letters and at the beginning or end of the TeX pattern (if there is not already a number)
|
||||
// 3) stripping all letters
|
||||
// Thus:
|
||||
// .ach4 > ach4 > 0a0c0h4 > 0004
|
||||
// 4ab. > 4ab > 4a0b0 > 400
|
||||
// a5ba1 > 0a5b0a1 > 0501
|
||||
//
|
||||
// The final sequence should be one character longer in length than the related word segment
|
||||
//
|
||||
// Lastly, the file name must be the languages "Language Code" formatted according to W3C format for language codes (see http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes)
|
||||
//
|
||||
// To activate the new language defination, simply save the file to the /php-typography/lang/ directory
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of wp-Typography.
|
||||
*
|
||||
* Copyright 2015 Peter Putzer.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package wpTypography/PHPTypography
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
/**
|
||||
* An autoloader implementation for the PHP_Typography classes.
|
||||
*
|
||||
* @param string $class_name Required.
|
||||
*/
|
||||
function php_typography_autoloader( $class_name ) {
|
||||
static $prefix;
|
||||
if ( empty( $prefix ) ) {
|
||||
$prefix = 'PHP_Typography\\';
|
||||
}
|
||||
|
||||
if ( false === strpos( $class_name, $prefix ) ) {
|
||||
return; // abort early.
|
||||
}
|
||||
|
||||
static $classes_dir;
|
||||
if ( empty( $classes_dir ) ) {
|
||||
$classes_dir = realpath( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR;
|
||||
}
|
||||
|
||||
$class_name_parts = explode( '\\', $class_name );
|
||||
$class_file = 'class-' . str_replace( '_', '-', strtolower( array_pop( $class_name_parts ) ) ) . '.php';
|
||||
if ( is_file( $class_file_path = $classes_dir . $class_file ) ) {
|
||||
require_once( $class_file_path );
|
||||
}
|
||||
}
|
||||
spl_autoload_register( 'php_typography_autoloader' );
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of wp-Typography.
|
||||
*
|
||||
* Copyright 2015 Peter Putzer.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package wpTypography/PHPTypography
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
if ( ! function_exists( 'clean_html' ) ) {
|
||||
/**
|
||||
* Return encoded HTML string (everything except <>"').
|
||||
*
|
||||
* @param string $html A HTML fragment.
|
||||
*/
|
||||
function clean_html( $html ) {
|
||||
static $convmap = array( 0x80, 0x10ffff, 0, 0xffffff );
|
||||
|
||||
return str_replace( array( '<', '>' ), array( '<', '>' ), mb_encode_numericentity( htmlentities( $html, ENT_NOQUOTES, 'UTF-8', false ), $convmap, 'UTF-8' ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Don't break without translation function.
|
||||
if ( ! function_exists( '__' ) ) {
|
||||
/**
|
||||
* Noop "translation" function for debugging.
|
||||
*
|
||||
* @param string $string Required.
|
||||
* @param string $domain Optional. Default null.
|
||||
*/
|
||||
function &__( $string, $domain = null ) { return $string; } // // @codingStandardsIgnoreLine.
|
||||
}
|
||||
if ( ! function_exists( '_e' ) ) {
|
||||
/**
|
||||
* Noop "translation" function for debugging.
|
||||
*
|
||||
* @param string $string Required.
|
||||
* @param string $domain Optional. Default null.
|
||||
*/
|
||||
function &_e( $string, $domain = null ) { return $string; } // @codingStandardsIgnoreLine.
|
||||
}
|
||||
|
|
@ -0,0 +1,216 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of wp-Typography.
|
||||
*
|
||||
* Copyright 2014-2016 Peter Putzer.
|
||||
* Copyright 2012-2013 Marie Hogebrandt.
|
||||
* Coypright 2009-2011 KINGdesk, LLC.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package wpTypography/PHPTypography
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
namespace PHP_Typography;
|
||||
|
||||
/**
|
||||
* HTML5 element introspection
|
||||
*/
|
||||
require_once( __DIR__ . '/../vendor/Masterminds/HTML5/Elements.php' ); // @codeCoverageIgnore
|
||||
|
||||
/**
|
||||
* Determines whether two object arrays intersect. The second array is expected
|
||||
* to use the spl_object_hash for its keys.
|
||||
*
|
||||
* @param array $array1 The keys are ignored.
|
||||
* @param array $array2 This array has to be in the form ( $spl_object_hash => $object ).
|
||||
* @return boolean
|
||||
*/
|
||||
function arrays_intersect( array $array1, array $array2 ) {
|
||||
foreach ( $array1 as $value ) {
|
||||
if ( isset( $array2[ spl_object_hash( $value ) ] ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert \DOMNodeList to array;
|
||||
*
|
||||
* @param \DOMNodeList $list Required.
|
||||
* @return array An associative array in the form ( $spl_object_hash => $node ).
|
||||
*/
|
||||
function nodelist_to_array( \DOMNodeList $list ) {
|
||||
$out = array();
|
||||
|
||||
foreach ( $list as $node ) {
|
||||
$out[ spl_object_hash( $node ) ] = $node;
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an array containing all the ancestors of the node. This could be done
|
||||
* via an XPath query for "ancestor::*", but DOM walking is in all likelyhood faster.
|
||||
*
|
||||
* @param \DOMNode $node Required.
|
||||
* @return array An array of \DOMNode.
|
||||
*/
|
||||
function get_ancestors( \DOMNode $node ) {
|
||||
$result = array();
|
||||
|
||||
while ( ( $node = $node->parentNode ) && ( $node instanceof \DOMElement ) ) { // @codingStandardsIgnoreLine.
|
||||
$result[] = $node;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the \DOMNode has one of the given classes.
|
||||
* If $tag is a \DOMText, the parent DOMElement is checked instead.
|
||||
*
|
||||
* @param \DOMNode $tag An element or textnode.
|
||||
* @param string|array $classnames A single classname or an array of classnames.
|
||||
*
|
||||
* @return boolean True if the element has any of the given class(es).
|
||||
*/
|
||||
function has_class( \DOMNode $tag, $classnames ) {
|
||||
if ( $tag instanceof \DOMText ) {
|
||||
$tag = $tag->parentNode; // @codingStandardsIgnoreLine.
|
||||
}
|
||||
|
||||
// Bail if we are not working with a tag or if there is no classname.
|
||||
if ( ! ( $tag instanceof \DOMElement ) || empty( $classnames ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ensure we always have an array of classnames.
|
||||
if ( ! is_array( $classnames ) ) {
|
||||
$classnames = array( $classnames );
|
||||
}
|
||||
|
||||
if ( $tag->hasAttribute( 'class' ) ) {
|
||||
$tag_classes = array_flip( explode( ' ', $tag->getAttribute( 'class' ) ) );
|
||||
|
||||
foreach ( $classnames as $classname ) {
|
||||
if ( isset( $tag_classes[ $classname ] ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert decimal value to unicode character.
|
||||
*
|
||||
* @param string|array $codes Decimal value(s) coresponding to unicode character(s).
|
||||
* @return string Unicode character(s).
|
||||
*/
|
||||
function uchr( $codes ) {
|
||||
if ( is_scalar( $codes ) ) {
|
||||
$codes = func_get_args();
|
||||
}
|
||||
|
||||
$str = '';
|
||||
foreach ( $codes as $code ) {
|
||||
$str .= html_entity_decode( '&#' . $code . ';', ENT_NOQUOTES, 'UTF-8' );
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is a number odd?
|
||||
*
|
||||
* @param integer $number Required.
|
||||
* @return boolean true if $number is odd, false if it is even.
|
||||
*/
|
||||
function is_odd( $number ) {
|
||||
return (boolean) ( $number % 2 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Multibyte-safe str_split function.
|
||||
*
|
||||
* @param string $str Required.
|
||||
* @param int $length Optional. Default 1.
|
||||
* @param string $encoding Optional. Default 'UTF-8'.
|
||||
*/
|
||||
function mb_str_split( $str, $length = 1, $encoding = 'UTF-8' ) {
|
||||
if ( $length < 1 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$result = array();
|
||||
$multibyte_length = mb_strlen( $str, $encoding );
|
||||
for ( $i = 0; $i < $multibyte_length; $i += $length ) {
|
||||
$result[] = mb_substr( $str, $i, $length, $encoding );
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of valid language plugins in the given directory.
|
||||
*
|
||||
* @param string $path The path in which to look for language plugin files.
|
||||
* @param string $language_name_variable The variable used for the language name in the plugin files.
|
||||
*
|
||||
* @return array An array in the form ( $language_code => $translated_language_name ).
|
||||
*/
|
||||
function get_language_plugin_list( $path, $language_name_variable ) {
|
||||
$language_name_pattern = '/\$' . $language_name_variable . '\s*=\s*((".+")|(\'.+\'))\s*;/';
|
||||
$languages = array();
|
||||
$handler = opendir( $path );
|
||||
|
||||
// Read all files in directory.
|
||||
while ( $file = readdir( $handler ) ) {
|
||||
// We only want the PHP files.
|
||||
if ( '.php' === substr( $file, -4 ) ) {
|
||||
$file_content = file_get_contents( $path . $file );
|
||||
if ( preg_match( $language_name_pattern, $file_content, $matches ) ) {
|
||||
// Normally this doesn't work, but we may have added the language name in the patgen file already.
|
||||
$language_name = /*__(*/ substr( $matches[1], 1, -1 ) /*, 'wp-typography' ) */; // @codingStandardsIgnoreLine.
|
||||
$language_code = substr( $file, 0, -4 );
|
||||
$languages[ $language_code ] = $language_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir( $handler );
|
||||
|
||||
// Sort translated language names according to current locale.
|
||||
asort( $languages );
|
||||
|
||||
return $languages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Include debugging helpers
|
||||
*/
|
||||
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { // @codeCoverageIgnoreStart
|
||||
define( 'WP_TYPOGRAPHY_DEBUG', true );
|
||||
}
|
||||
if ( defined( 'WP_TYPOGRAPHY_DEBUG' ) && WP_TYPOGRAPHY_DEBUG ) {
|
||||
include_once 'php-typography-debug.php';
|
||||
} // @codeCoverageIgnoreEnd
|
||||
64
site/OFF_plugins/typography/typography.php
Normal file
64
site/OFF_plugins/typography/typography.php
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of Kirby-Typography. A port of wp-Typography
|
||||
* for Kirby CMS (https://getkirby.com).
|
||||
*
|
||||
* Copyright of Kirby-Typography:
|
||||
* 2016 Fabian Michael.
|
||||
*
|
||||
* Copyright of wp-Typography (included in this package):
|
||||
* 2014-2016 Peter Putzer.
|
||||
* 2012-2013 Marie Hogebrandt.
|
||||
* 2009-2011 KINGdesk, LLC.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package Kirby\Plugings\Typography
|
||||
* @author Fabian Michael <hallo@fabianmichael.de>
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
namespace Kirby\Plugins\Typography;
|
||||
use C;
|
||||
|
||||
define('TYPOGRAPHY_PLUGIN_BASE_DIR', __DIR__);
|
||||
|
||||
load([
|
||||
// TypeSetter classes
|
||||
'kirby\\plugins\\typography\\kirbytypography' => 'lib' . DS . 'kirbytypography.php',
|
||||
'kirby\\plugins\\typography\\cache' => 'lib' . DS . 'cache.php',
|
||||
'kirby\\plugins\\typography\\component\\typography' => 'lib' . DS . 'component' . DS . 'typography.php',
|
||||
|
||||
// WP Typography classes
|
||||
'php_typography\\parse_text' => 'php-typography' . DS . 'class-parse-text.php',
|
||||
'php_typography\\php_typography' => 'php-typography' . DS . 'class-php-typography.php',
|
||||
|
||||
], TYPOGRAPHY_PLUGIN_BASE_DIR);
|
||||
|
||||
// Register plugin component
|
||||
$kirby->set('component', 'smartypants', 'kirby\\plugins\\typography\\component\\typography');
|
||||
|
||||
// Register dashboard widget if not disabled in config file
|
||||
if ( c::get('typography.widget') === null ) {
|
||||
c::set('typography.widget', true); // enable by default, if not explicitly set to `false`.
|
||||
$kirby->options['typography.widget'] = true;
|
||||
}
|
||||
|
||||
if ($kirby->option('typography.widget') !== false) {
|
||||
require_once __DIR__ . DS . 'widgets' . DS . 'typography' . DS . 'bootstrap.php';
|
||||
}
|
||||
1282
site/OFF_plugins/typography/vendor/IANA/tlds-alpha-by-domain.txt
vendored
Normal file
1282
site/OFF_plugins/typography/vendor/IANA/tlds-alpha-by-domain.txt
vendored
Normal file
File diff suppressed because it is too large
Load diff
250
site/OFF_plugins/typography/vendor/Masterminds/HTML5.php
vendored
Normal file
250
site/OFF_plugins/typography/vendor/Masterminds/HTML5.php
vendored
Normal file
|
|
@ -0,0 +1,250 @@
|
|||
<?php
|
||||
namespace Masterminds;
|
||||
|
||||
use Masterminds\HTML5\Parser\FileInputStream;
|
||||
use Masterminds\HTML5\Parser\StringInputStream;
|
||||
use Masterminds\HTML5\Parser\DOMTreeBuilder;
|
||||
use Masterminds\HTML5\Parser\Scanner;
|
||||
use Masterminds\HTML5\Parser\Tokenizer;
|
||||
use Masterminds\HTML5\Serializer\OutputRules;
|
||||
use Masterminds\HTML5\Serializer\Traverser;
|
||||
|
||||
/**
|
||||
* This class offers convenience methods for parsing and serializing HTML5.
|
||||
* It is roughly designed to mirror the \DOMDocument class that is
|
||||
* provided with most versions of PHP.
|
||||
*
|
||||
* EXPERIMENTAL. This may change or be completely replaced.
|
||||
*/
|
||||
class HTML5
|
||||
{
|
||||
|
||||
/**
|
||||
* Global options for the parser and serializer.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $options = array(
|
||||
// If the serializer should encode all entities.
|
||||
'encode_entities' => false
|
||||
);
|
||||
|
||||
protected $errors = array();
|
||||
|
||||
public function __construct(array $options = array())
|
||||
{
|
||||
$this->options = array_merge($this->options, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default options.
|
||||
*
|
||||
* @return array The default options.
|
||||
*/
|
||||
public function getOptions()
|
||||
{
|
||||
return $this->options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load and parse an HTML file.
|
||||
*
|
||||
* This will apply the HTML5 parser, which is tolerant of many
|
||||
* varieties of HTML, including XHTML 1, HTML 4, and well-formed HTML
|
||||
* 3. Note that in these cases, not all of the old data will be
|
||||
* preserved. For example, XHTML's XML declaration will be removed.
|
||||
*
|
||||
* The rules governing parsing are set out in the HTML 5 spec.
|
||||
*
|
||||
* @param string $file
|
||||
* The path to the file to parse. If this is a resource, it is
|
||||
* assumed to be an open stream whose pointer is set to the first
|
||||
* byte of input.
|
||||
* @param array $options
|
||||
* Configuration options when parsing the HTML
|
||||
* @return \DOMDocument A DOM document. These object type is defined by the libxml
|
||||
* library, and should have been included with your version of PHP.
|
||||
*/
|
||||
public function load($file, array $options = array())
|
||||
{
|
||||
// Handle the case where file is a resource.
|
||||
if (is_resource($file)) {
|
||||
// FIXME: We need a StreamInputStream class.
|
||||
return $this->loadHTML(stream_get_contents($file), $options);
|
||||
}
|
||||
|
||||
$input = new FileInputStream($file);
|
||||
|
||||
return $this->parse($input, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a HTML Document from a string.
|
||||
*
|
||||
* Take a string of HTML 5 (or earlier) and parse it into a
|
||||
* DOMDocument.
|
||||
*
|
||||
* @param string $string
|
||||
* A html5 document as a string.
|
||||
* @param array $options
|
||||
* Configuration options when parsing the HTML
|
||||
* @return \DOMDocument A DOM document. DOM is part of libxml, which is included with
|
||||
* almost all distribtions of PHP.
|
||||
*/
|
||||
public function loadHTML($string, array $options = array())
|
||||
{
|
||||
$input = new StringInputStream($string);
|
||||
|
||||
return $this->parse($input, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience function to load an HTML file.
|
||||
*
|
||||
* This is here to provide backwards compatibility with the
|
||||
* PHP DOM implementation. It simply calls load().
|
||||
*
|
||||
* @param string $file
|
||||
* The path to the file to parse. If this is a resource, it is
|
||||
* assumed to be an open stream whose pointer is set to the first
|
||||
* byte of input.
|
||||
* @param array $options
|
||||
* Configuration options when parsing the HTML
|
||||
*
|
||||
* @return \DOMDocument A DOM document. These object type is defined by the libxml
|
||||
* library, and should have been included with your version of PHP.
|
||||
*/
|
||||
public function loadHTMLFile($file, array $options = array())
|
||||
{
|
||||
return $this->load($file, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a HTML fragment from a string.
|
||||
*
|
||||
* @param string $string
|
||||
* The html5 fragment as a string.
|
||||
* @param array $options
|
||||
* Configuration options when parsing the HTML
|
||||
*
|
||||
* @return \DOMDocumentFragment A DOM fragment. The DOM is part of libxml, which is included with
|
||||
* almost all distributions of PHP.
|
||||
*/
|
||||
public function loadHTMLFragment($string, array $options = array())
|
||||
{
|
||||
$input = new StringInputStream($string);
|
||||
|
||||
return $this->parseFragment($input, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all errors encountered into parsing phase
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getErrors()
|
||||
{
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true it some errors were encountered into parsing phase
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasErrors()
|
||||
{
|
||||
return count($this->errors) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse an input stream.
|
||||
*
|
||||
* Lower-level loading function. This requires an input stream instead
|
||||
* of a string, file, or resource.
|
||||
*/
|
||||
public function parse(\Masterminds\HTML5\Parser\InputStream $input, array $options = array())
|
||||
{
|
||||
$this->errors = array();
|
||||
$events = new DOMTreeBuilder(false, array_merge($this->getOptions(), $options));
|
||||
$scanner = new Scanner($input);
|
||||
$parser = new Tokenizer($scanner, $events);
|
||||
|
||||
$parser->parse();
|
||||
$this->errors = $events->getErrors();
|
||||
|
||||
return $events->document();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse an input stream where the stream is a fragment.
|
||||
*
|
||||
* Lower-level loading function. This requires an input stream instead
|
||||
* of a string, file, or resource.
|
||||
*/
|
||||
public function parseFragment(\Masterminds\HTML5\Parser\InputStream $input, array $options = array())
|
||||
{
|
||||
$events = new DOMTreeBuilder(true, array_merge($this->getOptions(), $options));
|
||||
$scanner = new Scanner($input);
|
||||
$parser = new Tokenizer($scanner, $events);
|
||||
|
||||
$parser->parse();
|
||||
$this->errors = $events->getErrors();
|
||||
|
||||
return $events->fragment();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save a DOM into a given file as HTML5.
|
||||
*
|
||||
* @param mixed $dom
|
||||
* The DOM to be serialized.
|
||||
* @param string $file
|
||||
* The filename to be written.
|
||||
* @param array $options
|
||||
* Configuration options when serializing the DOM. These include:
|
||||
* - encode_entities: Text written to the output is escaped by default and not all
|
||||
* entities are encoded. If this is set to true all entities will be encoded.
|
||||
* Defaults to false.
|
||||
*/
|
||||
public function save($dom, $file, $options = array())
|
||||
{
|
||||
$close = true;
|
||||
if (is_resource($file)) {
|
||||
$stream = $file;
|
||||
$close = false;
|
||||
} else {
|
||||
$stream = fopen($file, 'w');
|
||||
}
|
||||
$options = array_merge($this->getOptions(), $options);
|
||||
$rules = new OutputRules($stream, $options);
|
||||
$trav = new Traverser($dom, $stream, $rules, $options);
|
||||
|
||||
$trav->walk();
|
||||
|
||||
if ($close) {
|
||||
fclose($stream);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a DOM into an HTML5 string.
|
||||
*
|
||||
* @param mixed $dom
|
||||
* The DOM to be serialized.
|
||||
* @param array $options
|
||||
* Configuration options when serializing the DOM. These include:
|
||||
* - encode_entities: Text written to the output is escaped by default and not all
|
||||
* entities are encoded. If this is set to true all entities will be encoded.
|
||||
* Defaults to false.
|
||||
*
|
||||
* @return string A HTML5 documented generated from the DOM.
|
||||
*/
|
||||
public function saveHTML($dom, $options = array())
|
||||
{
|
||||
$stream = fopen('php://temp', 'w');
|
||||
$this->save($dom, $stream, array_merge($this->getOptions(), $options));
|
||||
|
||||
return stream_get_contents($stream, - 1, 0);
|
||||
}
|
||||
}
|
||||
11
site/OFF_plugins/typography/vendor/Masterminds/HTML5/CREDITS
vendored
Normal file
11
site/OFF_plugins/typography/vendor/Masterminds/HTML5/CREDITS
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
Matt Butcher [technosophos] <technosophos@gmail.com> (lead)
|
||||
Matt Farina [mattfarina] <matt@mattfarina.com> (lead)
|
||||
Asmir Mustafic [goetas] <goetas@lignano.it> (contributor)
|
||||
Edward Z. Yang [ezyang] <ezyang@mit.edu> (contributor)
|
||||
Geoffrey Sneddon [gsnedders] <geoffers@gmail.com> (contributor)
|
||||
Kukhar Vasily [ngreduce] <ngreduce@gmail.com> (contributor)
|
||||
Rune Christensen [MrElectronic] <mrelectronic@example.com> (contributor)
|
||||
Mišo Belica [miso-belica] <miso-belica@example.com> (contributor)
|
||||
Asmir Mustafic [goetas] <goetas@example.com> (contributor)
|
||||
KITAITI Makoto [KitaitiMakoto] <KitaitiMakoto@example.com> (contributor)
|
||||
Jacob Floyd [cognifloyd] <cognifloyd@gmail.com> (contributor)
|
||||
634
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Elements.php
vendored
Normal file
634
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Elements.php
vendored
Normal file
|
|
@ -0,0 +1,634 @@
|
|||
<?php
|
||||
/**
|
||||
* Provide general element functions.
|
||||
*/
|
||||
namespace Masterminds\HTML5;
|
||||
|
||||
/**
|
||||
* This class provides general information about HTML5 elements,
|
||||
* including syntactic and semantic issues.
|
||||
* Parsers and serializers can
|
||||
* use this class as a reference point for information about the rules
|
||||
* of various HTML5 elements.
|
||||
*
|
||||
* @todo consider using a bitmask table lookup. There is enough overlap in
|
||||
* naming that this could significantly shrink the size and maybe make it
|
||||
* faster. See the Go teams implementation at https://code.google.com/p/go/source/browse/html/atom.
|
||||
*/
|
||||
class Elements
|
||||
{
|
||||
|
||||
/**
|
||||
* Indicates an element is described in the specification.
|
||||
*/
|
||||
const KNOWN_ELEMENT = 1;
|
||||
|
||||
// From section 8.1.2: "script", "style"
|
||||
// From 8.2.5.4.7 ("in body" insertion mode): "noembed"
|
||||
// From 8.4 "style", "xmp", "iframe", "noembed", "noframes"
|
||||
/**
|
||||
* Indicates the contained text should be processed as raw text.
|
||||
*/
|
||||
const TEXT_RAW = 2;
|
||||
|
||||
// From section 8.1.2: "textarea", "title"
|
||||
/**
|
||||
* Indicates the contained text should be processed as RCDATA.
|
||||
*/
|
||||
const TEXT_RCDATA = 4;
|
||||
|
||||
/**
|
||||
* Indicates the tag cannot have content.
|
||||
*/
|
||||
const VOID_TAG = 8;
|
||||
|
||||
// "address", "article", "aside", "blockquote", "center", "details", "dialog", "dir", "div", "dl",
|
||||
// "fieldset", "figcaption", "figure", "footer", "header", "hgroup", "menu",
|
||||
// "nav", "ol", "p", "section", "summary", "ul"
|
||||
// "h1", "h2", "h3", "h4", "h5", "h6"
|
||||
// "pre", "listing"
|
||||
// "form"
|
||||
// "plaintext"
|
||||
/**
|
||||
* Indicates that if a previous event is for a P tag, that element
|
||||
* should be considered closed.
|
||||
*/
|
||||
const AUTOCLOSE_P = 16;
|
||||
|
||||
/**
|
||||
* Indicates that the text inside is plaintext (pre).
|
||||
*/
|
||||
const TEXT_PLAINTEXT = 32;
|
||||
|
||||
// See https://developer.mozilla.org/en-US/docs/HTML/Block-level_elements
|
||||
/**
|
||||
* Indicates that the tag is a block.
|
||||
*/
|
||||
const BLOCK_TAG = 64;
|
||||
|
||||
/**
|
||||
* Indicates that the tag allows only inline elements as child nodes.
|
||||
*/
|
||||
const BLOCK_ONLY_INLINE = 128;
|
||||
|
||||
/**
|
||||
* The HTML5 elements as defined in http://dev.w3.org/html5/markup/elements.html.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $html5 = array(
|
||||
"a" => 1,
|
||||
"abbr" => 1,
|
||||
"address" => 65, // NORMAL | BLOCK_TAG
|
||||
"area" => 9, // NORMAL | VOID_TAG
|
||||
"article" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"aside" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"audio" => 65, // NORMAL | BLOCK_TAG
|
||||
"b" => 1,
|
||||
"base" => 9, // NORMAL | VOID_TAG
|
||||
"bdi" => 1,
|
||||
"bdo" => 1,
|
||||
"blockquote" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"body" => 1,
|
||||
"br" => 9, // NORMAL | VOID_TAG
|
||||
"button" => 1,
|
||||
"canvas" => 65, // NORMAL | BLOCK_TAG
|
||||
"caption" => 1,
|
||||
"cite" => 1,
|
||||
"code" => 1,
|
||||
"col" => 9, // NORMAL | VOID_TAG
|
||||
"colgroup" => 1,
|
||||
"command" => 9, // NORMAL | VOID_TAG
|
||||
// "data" => 1, // This is highly experimental and only part of the whatwg spec (not w3c). See https://developer.mozilla.org/en-US/docs/HTML/Element/data
|
||||
"datalist" => 1,
|
||||
"dd" => 65, // NORMAL | BLOCK_TAG
|
||||
"del" => 1,
|
||||
"details" => 17, // NORMAL | AUTOCLOSE_P,
|
||||
"dfn" => 1,
|
||||
"dialog" => 17, // NORMAL | AUTOCLOSE_P,
|
||||
"div" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"dl" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"dt" => 1,
|
||||
"em" => 1,
|
||||
"embed" => 9, // NORMAL | VOID_TAG
|
||||
"fieldset" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"figcaption" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"figure" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"footer" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"form" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"h1" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"h2" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"h3" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"h4" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"h5" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"h6" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"head" => 1,
|
||||
"header" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"hgroup" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"hr" => 73, // NORMAL | VOID_TAG
|
||||
"html" => 1,
|
||||
"i" => 1,
|
||||
"iframe" => 3, // NORMAL | TEXT_RAW
|
||||
"img" => 9, // NORMAL | VOID_TAG
|
||||
"input" => 9, // NORMAL | VOID_TAG
|
||||
"kbd" => 1,
|
||||
"ins" => 1,
|
||||
"keygen" => 9, // NORMAL | VOID_TAG
|
||||
"label" => 1,
|
||||
"legend" => 1,
|
||||
"li" => 1,
|
||||
"link" => 9, // NORMAL | VOID_TAG
|
||||
"map" => 1,
|
||||
"mark" => 1,
|
||||
"menu" => 17, // NORMAL | AUTOCLOSE_P,
|
||||
"meta" => 9, // NORMAL | VOID_TAG
|
||||
"meter" => 1,
|
||||
"nav" => 17, // NORMAL | AUTOCLOSE_P,
|
||||
"noscript" => 65, // NORMAL | BLOCK_TAG
|
||||
"object" => 1,
|
||||
"ol" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"optgroup" => 1,
|
||||
"option" => 1,
|
||||
"output" => 65, // NORMAL | BLOCK_TAG
|
||||
"p" => 209, // NORMAL | AUTOCLOSE_P | BLOCK_TAG | BLOCK_ONLY_INLINE
|
||||
"param" => 9, // NORMAL | VOID_TAG
|
||||
"pre" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"progress" => 1,
|
||||
"q" => 1,
|
||||
"rp" => 1,
|
||||
"rt" => 1,
|
||||
"ruby" => 1,
|
||||
"s" => 1,
|
||||
"samp" => 1,
|
||||
"script" => 3, // NORMAL | TEXT_RAW
|
||||
"section" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"select" => 1,
|
||||
"small" => 1,
|
||||
"source" => 9, // NORMAL | VOID_TAG
|
||||
"span" => 1,
|
||||
"strong" => 1,
|
||||
"style" => 3, // NORMAL | TEXT_RAW
|
||||
"sub" => 1,
|
||||
"summary" => 17, // NORMAL | AUTOCLOSE_P,
|
||||
"sup" => 1,
|
||||
"table" => 65, // NORMAL | BLOCK_TAG
|
||||
"tbody" => 1,
|
||||
"td" => 1,
|
||||
"textarea" => 5, // NORMAL | TEXT_RCDATA
|
||||
"tfoot" => 65, // NORMAL | BLOCK_TAG
|
||||
"th" => 1,
|
||||
"thead" => 1,
|
||||
"time" => 1,
|
||||
"title" => 5, // NORMAL | TEXT_RCDATA
|
||||
"tr" => 1,
|
||||
"track" => 9, // NORMAL | VOID_TAG
|
||||
"u" => 1,
|
||||
"ul" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG
|
||||
"var" => 1,
|
||||
"video" => 65, // NORMAL | BLOCK_TAG
|
||||
"wbr" => 9, // NORMAL | VOID_TAG
|
||||
|
||||
// Legacy?
|
||||
'basefont' => 8, // VOID_TAG
|
||||
'bgsound' => 8, // VOID_TAG
|
||||
'noframes' => 2, // RAW_TEXT
|
||||
'frame' => 9, // NORMAL | VOID_TAG
|
||||
'frameset' => 1,
|
||||
'center' => 16,
|
||||
'dir' => 16,
|
||||
'listing' => 16, // AUTOCLOSE_P
|
||||
'plaintext' => 48, // AUTOCLOSE_P | TEXT_PLAINTEXT
|
||||
'applet' => 0,
|
||||
'marquee' => 0,
|
||||
'isindex' => 8, // VOID_TAG
|
||||
'xmp' => 20, // AUTOCLOSE_P | VOID_TAG | RAW_TEXT
|
||||
'noembed' => 2 // RAW_TEXT
|
||||
);
|
||||
|
||||
/**
|
||||
* The MathML elements.
|
||||
* See http://www.w3.org/wiki/MathML/Elements.
|
||||
*
|
||||
* In our case we are only concerned with presentation MathML and not content
|
||||
* MathML. There is a nice list of this subset at https://developer.mozilla.org/en-US/docs/MathML/Element.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $mathml = array(
|
||||
"maction" => 1,
|
||||
"maligngroup" => 1,
|
||||
"malignmark" => 1,
|
||||
"math" => 1,
|
||||
"menclose" => 1,
|
||||
"merror" => 1,
|
||||
"mfenced" => 1,
|
||||
"mfrac" => 1,
|
||||
"mglyph" => 1,
|
||||
"mi" => 1,
|
||||
"mlabeledtr" => 1,
|
||||
"mlongdiv" => 1,
|
||||
"mmultiscripts" => 1,
|
||||
"mn" => 1,
|
||||
"mo" => 1,
|
||||
"mover" => 1,
|
||||
"mpadded" => 1,
|
||||
"mphantom" => 1,
|
||||
"mroot" => 1,
|
||||
"mrow" => 1,
|
||||
"ms" => 1,
|
||||
"mscarries" => 1,
|
||||
"mscarry" => 1,
|
||||
"msgroup" => 1,
|
||||
"msline" => 1,
|
||||
"mspace" => 1,
|
||||
"msqrt" => 1,
|
||||
"msrow" => 1,
|
||||
"mstack" => 1,
|
||||
"mstyle" => 1,
|
||||
"msub" => 1,
|
||||
"msup" => 1,
|
||||
"msubsup" => 1,
|
||||
"mtable" => 1,
|
||||
"mtd" => 1,
|
||||
"mtext" => 1,
|
||||
"mtr" => 1,
|
||||
"munder" => 1,
|
||||
"munderover" => 1
|
||||
);
|
||||
|
||||
/**
|
||||
* The svg elements.
|
||||
*
|
||||
* The Mozilla documentation has a good list at https://developer.mozilla.org/en-US/docs/SVG/Element.
|
||||
* The w3c list appears to be lacking in some areas like filter effect elements.
|
||||
* That list can be found at http://www.w3.org/wiki/SVG/Elements.
|
||||
*
|
||||
* Note, FireFox appears to do a better job rendering filter effects than chrome.
|
||||
* While they are in the spec I'm not sure how widely implemented they are.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $svg = array(
|
||||
"a" => 1,
|
||||
"altGlyph" => 1,
|
||||
"altGlyphDef" => 1,
|
||||
"altGlyphItem" => 1,
|
||||
"animate" => 1,
|
||||
"animateColor" => 1,
|
||||
"animateMotion" => 1,
|
||||
"animateTransform" => 1,
|
||||
"circle" => 1,
|
||||
"clipPath" => 1,
|
||||
"color-profile" => 1,
|
||||
"cursor" => 1,
|
||||
"defs" => 1,
|
||||
"desc" => 1,
|
||||
"ellipse" => 1,
|
||||
"feBlend" => 1,
|
||||
"feColorMatrix" => 1,
|
||||
"feComponentTransfer" => 1,
|
||||
"feComposite" => 1,
|
||||
"feConvolveMatrix" => 1,
|
||||
"feDiffuseLighting" => 1,
|
||||
"feDisplacementMap" => 1,
|
||||
"feDistantLight" => 1,
|
||||
"feFlood" => 1,
|
||||
"feFuncA" => 1,
|
||||
"feFuncB" => 1,
|
||||
"feFuncG" => 1,
|
||||
"feFuncR" => 1,
|
||||
"feGaussianBlur" => 1,
|
||||
"feImage" => 1,
|
||||
"feMerge" => 1,
|
||||
"feMergeNode" => 1,
|
||||
"feMorphology" => 1,
|
||||
"feOffset" => 1,
|
||||
"fePointLight" => 1,
|
||||
"feSpecularLighting" => 1,
|
||||
"feSpotLight" => 1,
|
||||
"feTile" => 1,
|
||||
"feTurbulence" => 1,
|
||||
"filter" => 1,
|
||||
"font" => 1,
|
||||
"font-face" => 1,
|
||||
"font-face-format" => 1,
|
||||
"font-face-name" => 1,
|
||||
"font-face-src" => 1,
|
||||
"font-face-uri" => 1,
|
||||
"foreignObject" => 1,
|
||||
"g" => 1,
|
||||
"glyph" => 1,
|
||||
"glyphRef" => 1,
|
||||
"hkern" => 1,
|
||||
"image" => 1,
|
||||
"line" => 1,
|
||||
"linearGradient" => 1,
|
||||
"marker" => 1,
|
||||
"mask" => 1,
|
||||
"metadata" => 1,
|
||||
"missing-glyph" => 1,
|
||||
"mpath" => 1,
|
||||
"path" => 1,
|
||||
"pattern" => 1,
|
||||
"polygon" => 1,
|
||||
"polyline" => 1,
|
||||
"radialGradient" => 1,
|
||||
"rect" => 1,
|
||||
"script" => 3, // NORMAL | RAW_TEXT
|
||||
"set" => 1,
|
||||
"stop" => 1,
|
||||
"style" => 3, // NORMAL | RAW_TEXT
|
||||
"svg" => 1,
|
||||
"switch" => 1,
|
||||
"symbol" => 1,
|
||||
"text" => 1,
|
||||
"textPath" => 1,
|
||||
"title" => 1,
|
||||
"tref" => 1,
|
||||
"tspan" => 1,
|
||||
"use" => 1,
|
||||
"view" => 1,
|
||||
"vkern" => 1
|
||||
);
|
||||
|
||||
/**
|
||||
* Some attributes in SVG are case sensetitive.
|
||||
*
|
||||
* This map contains key/value pairs with the key as the lowercase attribute
|
||||
* name and the value with the correct casing.
|
||||
*/
|
||||
public static $svgCaseSensitiveAttributeMap = array(
|
||||
'attributename' => 'attributeName',
|
||||
'attributetype' => 'attributeType',
|
||||
'basefrequency' => 'baseFrequency',
|
||||
'baseprofile' => 'baseProfile',
|
||||
'calcmode' => 'calcMode',
|
||||
'clippathunits' => 'clipPathUnits',
|
||||
'contentscripttype' => 'contentScriptType',
|
||||
'contentstyletype' => 'contentStyleType',
|
||||
'diffuseconstant' => 'diffuseConstant',
|
||||
'edgemode' => 'edgeMode',
|
||||
'externalresourcesrequired' => 'externalResourcesRequired',
|
||||
'filterres' => 'filterRes',
|
||||
'filterunits' => 'filterUnits',
|
||||
'glyphref' => 'glyphRef',
|
||||
'gradienttransform' => 'gradientTransform',
|
||||
'gradientunits' => 'gradientUnits',
|
||||
'kernelmatrix' => 'kernelMatrix',
|
||||
'kernelunitlength' => 'kernelUnitLength',
|
||||
'keypoints' => 'keyPoints',
|
||||
'keysplines' => 'keySplines',
|
||||
'keytimes' => 'keyTimes',
|
||||
'lengthadjust' => 'lengthAdjust',
|
||||
'limitingconeangle' => 'limitingConeAngle',
|
||||
'markerheight' => 'markerHeight',
|
||||
'markerunits' => 'markerUnits',
|
||||
'markerwidth' => 'markerWidth',
|
||||
'maskcontentunits' => 'maskContentUnits',
|
||||
'maskunits' => 'maskUnits',
|
||||
'numoctaves' => 'numOctaves',
|
||||
'pathlength' => 'pathLength',
|
||||
'patterncontentunits' => 'patternContentUnits',
|
||||
'patterntransform' => 'patternTransform',
|
||||
'patternunits' => 'patternUnits',
|
||||
'pointsatx' => 'pointsAtX',
|
||||
'pointsaty' => 'pointsAtY',
|
||||
'pointsatz' => 'pointsAtZ',
|
||||
'preservealpha' => 'preserveAlpha',
|
||||
'preserveaspectratio' => 'preserveAspectRatio',
|
||||
'primitiveunits' => 'primitiveUnits',
|
||||
'refx' => 'refX',
|
||||
'refy' => 'refY',
|
||||
'repeatcount' => 'repeatCount',
|
||||
'repeatdur' => 'repeatDur',
|
||||
'requiredextensions' => 'requiredExtensions',
|
||||
'requiredfeatures' => 'requiredFeatures',
|
||||
'specularconstant' => 'specularConstant',
|
||||
'specularexponent' => 'specularExponent',
|
||||
'spreadmethod' => 'spreadMethod',
|
||||
'startoffset' => 'startOffset',
|
||||
'stddeviation' => 'stdDeviation',
|
||||
'stitchtiles' => 'stitchTiles',
|
||||
'surfacescale' => 'surfaceScale',
|
||||
'systemlanguage' => 'systemLanguage',
|
||||
'tablevalues' => 'tableValues',
|
||||
'targetx' => 'targetX',
|
||||
'targety' => 'targetY',
|
||||
'textlength' => 'textLength',
|
||||
'viewbox' => 'viewBox',
|
||||
'viewtarget' => 'viewTarget',
|
||||
'xchannelselector' => 'xChannelSelector',
|
||||
'ychannelselector' => 'yChannelSelector',
|
||||
'zoomandpan' => 'zoomAndPan'
|
||||
);
|
||||
|
||||
/**
|
||||
* Some SVG elements are case sensetitive.
|
||||
* This map contains these.
|
||||
*
|
||||
* The map contains key/value store of the name is lowercase as the keys and
|
||||
* the correct casing as the value.
|
||||
*/
|
||||
public static $svgCaseSensitiveElementMap = array(
|
||||
'altglyph' => 'altGlyph',
|
||||
'altglyphdef' => 'altGlyphDef',
|
||||
'altglyphitem' => 'altGlyphItem',
|
||||
'animatecolor' => 'animateColor',
|
||||
'animatemotion' => 'animateMotion',
|
||||
'animatetransform' => 'animateTransform',
|
||||
'clippath' => 'clipPath',
|
||||
'feblend' => 'feBlend',
|
||||
'fecolormatrix' => 'feColorMatrix',
|
||||
'fecomponenttransfer' => 'feComponentTransfer',
|
||||
'fecomposite' => 'feComposite',
|
||||
'feconvolvematrix' => 'feConvolveMatrix',
|
||||
'fediffuselighting' => 'feDiffuseLighting',
|
||||
'fedisplacementmap' => 'feDisplacementMap',
|
||||
'fedistantlight' => 'feDistantLight',
|
||||
'feflood' => 'feFlood',
|
||||
'fefunca' => 'feFuncA',
|
||||
'fefuncb' => 'feFuncB',
|
||||
'fefuncg' => 'feFuncG',
|
||||
'fefuncr' => 'feFuncR',
|
||||
'fegaussianblur' => 'feGaussianBlur',
|
||||
'feimage' => 'feImage',
|
||||
'femerge' => 'feMerge',
|
||||
'femergenode' => 'feMergeNode',
|
||||
'femorphology' => 'feMorphology',
|
||||
'feoffset' => 'feOffset',
|
||||
'fepointlight' => 'fePointLight',
|
||||
'fespecularlighting' => 'feSpecularLighting',
|
||||
'fespotlight' => 'feSpotLight',
|
||||
'fetile' => 'feTile',
|
||||
'feturbulence' => 'feTurbulence',
|
||||
'foreignobject' => 'foreignObject',
|
||||
'glyphref' => 'glyphRef',
|
||||
'lineargradient' => 'linearGradient',
|
||||
'radialgradient' => 'radialGradient',
|
||||
'textpath' => 'textPath'
|
||||
);
|
||||
|
||||
/**
|
||||
* Check whether the given element meets the given criterion.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* Elements::isA('script', Elements::TEXT_RAW); // Returns true.
|
||||
*
|
||||
* Elements::isA('script', Elements::TEXT_RCDATA); // Returns false.
|
||||
*
|
||||
* @param string $name
|
||||
* The element name.
|
||||
* @param int $mask
|
||||
* One of the constants on this class.
|
||||
* @return boolean true if the element matches the mask, false otherwise.
|
||||
*/
|
||||
public static function isA($name, $mask)
|
||||
{
|
||||
if (! static::isElement($name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (static::element($name) & $mask) == $mask;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if an element is a valid html5 element.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the element.
|
||||
*
|
||||
* @return bool True if a html5 element and false otherwise.
|
||||
*/
|
||||
public static function isHtml5Element($name)
|
||||
{
|
||||
// html5 element names are case insensetitive. Forcing lowercase for the check.
|
||||
// Do we need this check or will all data passed here already be lowercase?
|
||||
return isset(static::$html5[strtolower($name)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if an element name is a valid MathML presentation element.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the element.
|
||||
*
|
||||
* @return bool True if a MathML name and false otherwise.
|
||||
*/
|
||||
public static function isMathMLElement($name)
|
||||
{
|
||||
// MathML is case-sensetitive unlike html5 elements.
|
||||
return isset(static::$mathml[$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if an element is a valid SVG element.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the element.
|
||||
*
|
||||
* @return boolean True if a SVG element and false otherise.
|
||||
*/
|
||||
public static function isSvgElement($name)
|
||||
{
|
||||
// SVG is case-sensetitive unlike html5 elements.
|
||||
return isset(static::$svg[$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is an element name valid in an html5 document.
|
||||
*
|
||||
* This includes html5 elements along with other allowed embedded content
|
||||
* such as svg and mathml.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the element.
|
||||
*
|
||||
* @return bool True if valid and false otherwise.
|
||||
*/
|
||||
public static function isElement($name)
|
||||
{
|
||||
return static::isHtml5Element($name) || static::isMathMLElement($name) || static::isSvgElement($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the element mask for the given element name.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the element.
|
||||
*
|
||||
* @return int|bool The element mask or false if element does not exist.
|
||||
*/
|
||||
public static function element($name)
|
||||
{
|
||||
if (isset(static::$html5[$name])) {
|
||||
return static::$html5[$name];
|
||||
}
|
||||
if (isset(static::$svg[$name])) {
|
||||
return static::$svg[$name];
|
||||
}
|
||||
if (isset(static::$mathml[$name])) {
|
||||
return static::$mathml[$name];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize a SVG element name to its proper case and form.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the element.
|
||||
*
|
||||
* @return string The normalized form of the element name.
|
||||
*/
|
||||
public static function normalizeSvgElement($name)
|
||||
{
|
||||
$name = strtolower($name);
|
||||
if (isset(static::$svgCaseSensitiveElementMap[$name])) {
|
||||
$name = static::$svgCaseSensitiveElementMap[$name];
|
||||
}
|
||||
|
||||
return $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize a SVG attribute name to its proper case and form.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the attribute.
|
||||
*
|
||||
* @return string The normalized form of the attribute name.
|
||||
*/
|
||||
public static function normalizeSvgAttribute($name)
|
||||
{
|
||||
$name = strtolower($name);
|
||||
if (isset(static::$svgCaseSensitiveAttributeMap[$name])) {
|
||||
$name = static::$svgCaseSensitiveAttributeMap[$name];
|
||||
}
|
||||
|
||||
return $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize a MathML attribute name to its proper case and form.
|
||||
*
|
||||
* Note, all MathML element names are lowercase.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the attribute.
|
||||
*
|
||||
* @return string The normalized form of the attribute name.
|
||||
*/
|
||||
public static function normalizeMathMlAttribute($name)
|
||||
{
|
||||
$name = strtolower($name);
|
||||
|
||||
// Only one attribute has a mixed case form for MathML.
|
||||
if ($name == 'definitionurl') {
|
||||
$name = 'definitionURL';
|
||||
}
|
||||
|
||||
return $name;
|
||||
}
|
||||
}
|
||||
2236
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Entities.php
vendored
Normal file
2236
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Entities.php
vendored
Normal file
File diff suppressed because it is too large
Load diff
9
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Exception.php
vendored
Normal file
9
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Exception.php
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Masterminds\HTML5;
|
||||
|
||||
/**
|
||||
* The base exception for the HTML5 project.
|
||||
*/
|
||||
class Exception extends \Exception
|
||||
{
|
||||
}
|
||||
43
site/OFF_plugins/typography/vendor/Masterminds/HTML5/InstructionProcessor.php
vendored
Normal file
43
site/OFF_plugins/typography/vendor/Masterminds/HTML5/InstructionProcessor.php
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
/**
|
||||
* A handler for processor instructions.
|
||||
*/
|
||||
namespace Masterminds\HTML5;
|
||||
|
||||
/**
|
||||
* Provide an processor to handle embedded instructions.
|
||||
*
|
||||
* XML defines a mechanism for inserting instructions (like PHP) into a
|
||||
* document. These are called "Processor Instructions." The HTML5 parser
|
||||
* provides an opportunity to handle these processor instructions during
|
||||
* the tree-building phase (before the DOM is constructed), which makes
|
||||
* it possible to alter the document as it is being created.
|
||||
*
|
||||
* One could, for example, use this mechanism to execute well-formed PHP
|
||||
* code embedded inside of an HTML5 document.
|
||||
*/
|
||||
interface InstructionProcessor
|
||||
{
|
||||
|
||||
/**
|
||||
* Process an individual processing instruction.
|
||||
*
|
||||
* The process() function is responsible for doing the following:
|
||||
* - Determining whether $name is an instruction type it can handle.
|
||||
* - Determining what to do with the data passed in.
|
||||
* - Making any subsequent modifications to the DOM by modifying the
|
||||
* DOMElement or its attached DOM tree.
|
||||
*
|
||||
* @param DOMElement $element
|
||||
* The parent element for the current processing instruction.
|
||||
* @param string $name
|
||||
* The instruction's name. E.g. `<?php` has the name `php`.
|
||||
* @param string $data
|
||||
* All of the data between the opening and closing PI marks.
|
||||
* @return DOMElement The element that should be considered "Current". This may just be
|
||||
* the element passed in, but if the processor added more elements,
|
||||
* it may choose to reset the current element to one of the elements
|
||||
* it created. (When in doubt, return the element passed in.)
|
||||
*/
|
||||
public function process(\DOMElement $element, $name, $data);
|
||||
}
|
||||
66
site/OFF_plugins/typography/vendor/Masterminds/HTML5/LICENSE
vendored
Normal file
66
site/OFF_plugins/typography/vendor/Masterminds/HTML5/LICENSE
vendored
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
## HTML5-PHP License
|
||||
|
||||
Copyright (c) 2013 The Authors of HTML5-PHP
|
||||
|
||||
Matt Butcher - mattbutcher@google.com
|
||||
Matt Farina - matt@mattfarina.com
|
||||
Asmir Mustafic - goetas@gmail.com
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS 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. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
## HTML5Lib License
|
||||
|
||||
Portions of this are based on html5lib's PHP version, which was a
|
||||
sub-project of html5lib. The following is the list of contributors from
|
||||
html5lib:
|
||||
|
||||
html5lib:
|
||||
|
||||
Copyright (c) 2006-2009 The Authors
|
||||
|
||||
Contributors:
|
||||
James Graham - jg307@cam.ac.uk
|
||||
Anne van Kesteren - annevankesteren@gmail.com
|
||||
Lachlan Hunt - lachlan.hunt@lachy.id.au
|
||||
Matt McDonald - kanashii@kanashii.ca
|
||||
Sam Ruby - rubys@intertwingly.net
|
||||
Ian Hickson (Google) - ian@hixie.ch
|
||||
Thomas Broyer - t.broyer@ltgt.net
|
||||
Jacques Distler - distler@golem.ph.utexas.edu
|
||||
Henri Sivonen - hsivonen@iki.fi
|
||||
Adam Barth - abarth@webkit.org
|
||||
Eric Seidel - eric@webkit.org
|
||||
The Mozilla Foundation (contributions from Henri Sivonen since 2008)
|
||||
David Flanagan (Mozilla) - dflanagan@mozilla.com
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS 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. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
63
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/CharacterReference.php
vendored
Normal file
63
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/CharacterReference.php
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
namespace Masterminds\HTML5\Parser;
|
||||
|
||||
use Masterminds\HTML5\Entities;
|
||||
|
||||
/**
|
||||
* Manage entity references.
|
||||
*
|
||||
* This is a simple resolver for HTML5 character reference entitites.
|
||||
* See \Masterminds\HTML5\Entities for the list of supported entities.
|
||||
*/
|
||||
class CharacterReference
|
||||
{
|
||||
|
||||
protected static $numeric_mask = array(
|
||||
0x0,
|
||||
0x2FFFF,
|
||||
0,
|
||||
0xFFFF
|
||||
);
|
||||
|
||||
/**
|
||||
* Given a name (e.g.
|
||||
* 'amp'), lookup the UTF-8 character ('&')
|
||||
*
|
||||
* @param string $name
|
||||
* The name to look up.
|
||||
* @return string The character sequence. In UTF-8 this may be more than one byte.
|
||||
*/
|
||||
public static function lookupName($name)
|
||||
{
|
||||
// Do we really want to return NULL here? or FFFD
|
||||
return isset(Entities::$byName[$name]) ? Entities::$byName[$name] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a Unicode codepoint, return the UTF-8 character.
|
||||
*
|
||||
* (NOT USED ANYWHERE)
|
||||
*/
|
||||
/*
|
||||
* public static function lookupCode($codePoint) { return 'POINT'; }
|
||||
*/
|
||||
|
||||
/**
|
||||
* Given a decimal number, return the UTF-8 character.
|
||||
*/
|
||||
public static function lookupDecimal($int)
|
||||
{
|
||||
$entity = '&#' . $int . ';';
|
||||
// UNTESTED: This may fail on some planes. Couldn't find full documentation
|
||||
// on the value of the mask array.
|
||||
return mb_decode_numericentity($entity, static::$numeric_mask, 'utf-8');
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a hexidecimal number, return the UTF-8 character.
|
||||
*/
|
||||
public static function lookupHex($hexdec)
|
||||
{
|
||||
return static::lookupDecimal(hexdec($hexdec));
|
||||
}
|
||||
}
|
||||
684
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/DOMTreeBuilder.php
vendored
Normal file
684
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/DOMTreeBuilder.php
vendored
Normal file
|
|
@ -0,0 +1,684 @@
|
|||
<?php
|
||||
namespace Masterminds\HTML5\Parser;
|
||||
|
||||
use Masterminds\HTML5\Elements;
|
||||
|
||||
/**
|
||||
* Create an HTML5 DOM tree from events.
|
||||
*
|
||||
* This attempts to create a DOM from events emitted by a parser. This
|
||||
* attempts (but does not guarantee) to up-convert older HTML documents
|
||||
* to HTML5. It does this by applying HTML5's rules, but it will not
|
||||
* change the architecture of the document itself.
|
||||
*
|
||||
* Many of the error correction and quirks features suggested in the specification
|
||||
* are implemented herein; however, not all of them are. Since we do not
|
||||
* assume a graphical user agent, no presentation-specific logic is conducted
|
||||
* during tree building.
|
||||
*
|
||||
* FIXME: The present tree builder does not exactly follow the state machine rules
|
||||
* for insert modes as outlined in the HTML5 spec. The processor needs to be
|
||||
* re-written to accomodate this. See, for example, the Go language HTML5
|
||||
* parser.
|
||||
*/
|
||||
class DOMTreeBuilder implements EventHandler
|
||||
{
|
||||
/**
|
||||
* Defined in http://www.w3.org/TR/html51/infrastructure.html#html-namespace-0
|
||||
*/
|
||||
const NAMESPACE_HTML = 'http://www.w3.org/1999/xhtml';
|
||||
|
||||
const NAMESPACE_MATHML = 'http://www.w3.org/1998/Math/MathML';
|
||||
|
||||
const NAMESPACE_SVG = 'http://www.w3.org/2000/svg';
|
||||
|
||||
const NAMESPACE_XLINK = 'http://www.w3.org/1999/xlink';
|
||||
|
||||
const NAMESPACE_XML = 'http://www.w3.org/XML/1998/namespace';
|
||||
|
||||
const NAMESPACE_XMLNS = 'http://www.w3.org/2000/xmlns/';
|
||||
|
||||
const OPT_DISABLE_HTML_NS = 'disable_html_ns';
|
||||
|
||||
const OPT_TARGET_DOC = 'target_document';
|
||||
|
||||
const OPT_IMPLICIT_NS = 'implicit_namespaces';
|
||||
|
||||
/**
|
||||
* Holds the HTML5 element names that causes a namespace switch
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $nsRoots = array(
|
||||
'html' => self::NAMESPACE_HTML,
|
||||
'svg' => self::NAMESPACE_SVG,
|
||||
'math' => self::NAMESPACE_MATHML
|
||||
);
|
||||
|
||||
/**
|
||||
* Holds the always available namespaces (which does not require the XMLNS declaration).
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $implicitNamespaces = array(
|
||||
'xml' => self::NAMESPACE_XML,
|
||||
'xmlns' => self::NAMESPACE_XMLNS,
|
||||
'xlink' => self::NAMESPACE_XLINK
|
||||
);
|
||||
|
||||
/**
|
||||
* Holds a stack of currently active namespaces.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $nsStack = array();
|
||||
|
||||
/**
|
||||
* Holds the number of namespaces declared by a node.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $pushes = array();
|
||||
|
||||
/**
|
||||
* Defined in 8.2.5.
|
||||
*/
|
||||
const IM_INITIAL = 0;
|
||||
|
||||
const IM_BEFORE_HTML = 1;
|
||||
|
||||
const IM_BEFORE_HEAD = 2;
|
||||
|
||||
const IM_IN_HEAD = 3;
|
||||
|
||||
const IM_IN_HEAD_NOSCRIPT = 4;
|
||||
|
||||
const IM_AFTER_HEAD = 5;
|
||||
|
||||
const IM_IN_BODY = 6;
|
||||
|
||||
const IM_TEXT = 7;
|
||||
|
||||
const IM_IN_TABLE = 8;
|
||||
|
||||
const IM_IN_TABLE_TEXT = 9;
|
||||
|
||||
const IM_IN_CAPTION = 10;
|
||||
|
||||
const IM_IN_COLUMN_GROUP = 11;
|
||||
|
||||
const IM_IN_TABLE_BODY = 12;
|
||||
|
||||
const IM_IN_ROW = 13;
|
||||
|
||||
const IM_IN_CELL = 14;
|
||||
|
||||
const IM_IN_SELECT = 15;
|
||||
|
||||
const IM_IN_SELECT_IN_TABLE = 16;
|
||||
|
||||
const IM_AFTER_BODY = 17;
|
||||
|
||||
const IM_IN_FRAMESET = 18;
|
||||
|
||||
const IM_AFTER_FRAMESET = 19;
|
||||
|
||||
const IM_AFTER_AFTER_BODY = 20;
|
||||
|
||||
const IM_AFTER_AFTER_FRAMESET = 21;
|
||||
|
||||
const IM_IN_SVG = 22;
|
||||
|
||||
const IM_IN_MATHML = 23;
|
||||
|
||||
protected $options = array();
|
||||
|
||||
protected $stack = array();
|
||||
|
||||
protected $current; // Pointer in the tag hierarchy.
|
||||
protected $doc;
|
||||
|
||||
protected $frag;
|
||||
|
||||
protected $processor;
|
||||
|
||||
protected $insertMode = 0;
|
||||
|
||||
/**
|
||||
* Track if we are in an element that allows only inline child nodes
|
||||
* @var string|null
|
||||
*/
|
||||
protected $onlyInline;
|
||||
|
||||
/**
|
||||
* Quirks mode is enabled by default.
|
||||
* Any document that is missing the
|
||||
* DT will be considered to be in quirks mode.
|
||||
*/
|
||||
protected $quirks = true;
|
||||
|
||||
protected $errors = array();
|
||||
|
||||
public function __construct($isFragment = false, array $options = array())
|
||||
{
|
||||
$this->options = $options;
|
||||
|
||||
if (isset($options[self::OPT_TARGET_DOC])) {
|
||||
$this->doc = $options[self::OPT_TARGET_DOC];
|
||||
} else {
|
||||
$impl = new \DOMImplementation();
|
||||
// XXX:
|
||||
// Create the doctype. For now, we are always creating HTML5
|
||||
// documents, and attempting to up-convert any older DTDs to HTML5.
|
||||
$dt = $impl->createDocumentType('html');
|
||||
// $this->doc = \DOMImplementation::createDocument(NULL, 'html', $dt);
|
||||
$this->doc = $impl->createDocument(null, null, $dt);
|
||||
}
|
||||
$this->errors = array();
|
||||
|
||||
$this->current = $this->doc; // ->documentElement;
|
||||
|
||||
// Create a rules engine for tags.
|
||||
$this->rules = new TreeBuildingRules($this->doc);
|
||||
|
||||
$implicitNS = array();
|
||||
if (isset($this->options[self::OPT_IMPLICIT_NS])) {
|
||||
$implicitNS = $this->options[self::OPT_IMPLICIT_NS];
|
||||
} elseif (isset($this->options["implicitNamespaces"])) {
|
||||
$implicitNS = $this->options["implicitNamespaces"];
|
||||
}
|
||||
|
||||
// Fill $nsStack with the defalut HTML5 namespaces, plus the "implicitNamespaces" array taken form $options
|
||||
array_unshift($this->nsStack, $implicitNS + array(
|
||||
'' => self::NAMESPACE_HTML
|
||||
) + $this->implicitNamespaces);
|
||||
|
||||
if ($isFragment) {
|
||||
$this->insertMode = static::IM_IN_BODY;
|
||||
$this->frag = $this->doc->createDocumentFragment();
|
||||
$this->current = $this->frag;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the document.
|
||||
*/
|
||||
public function document()
|
||||
{
|
||||
return $this->doc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the DOM fragment for the body.
|
||||
*
|
||||
* This returns a DOMNodeList because a fragment may have zero or more
|
||||
* DOMNodes at its root.
|
||||
*
|
||||
* @see http://www.w3.org/TR/2012/CR-html5-20121217/syntax.html#concept-frag-parse-context
|
||||
*
|
||||
* @return \DOMFragmentDocumentFragment
|
||||
*/
|
||||
public function fragment()
|
||||
{
|
||||
return $this->frag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide an instruction processor.
|
||||
*
|
||||
* This is used for handling Processor Instructions as they are
|
||||
* inserted. If omitted, PI's are inserted directly into the DOM tree.
|
||||
*/
|
||||
public function setInstructionProcessor(\Masterminds\HTML5\InstructionProcessor $proc)
|
||||
{
|
||||
$this->processor = $proc;
|
||||
}
|
||||
|
||||
public function doctype($name, $idType = 0, $id = null, $quirks = false)
|
||||
{
|
||||
// This is used solely for setting quirks mode. Currently we don't
|
||||
// try to preserve the inbound DT. We convert it to HTML5.
|
||||
$this->quirks = $quirks;
|
||||
|
||||
if ($this->insertMode > static::IM_INITIAL) {
|
||||
$this->parseError("Illegal placement of DOCTYPE tag. Ignoring: " . $name);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->insertMode = static::IM_BEFORE_HTML;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the start tag.
|
||||
*
|
||||
* @todo - XMLNS namespace handling (we need to parse, even if it's not valid)
|
||||
* - XLink, MathML and SVG namespace handling
|
||||
* - Omission rules: 8.1.2.4 Optional tags
|
||||
*/
|
||||
public function startTag($name, $attributes = array(), $selfClosing = false)
|
||||
{
|
||||
// fprintf(STDOUT, $name);
|
||||
$lname = $this->normalizeTagName($name);
|
||||
|
||||
// Make sure we have an html element.
|
||||
if (! $this->doc->documentElement && $name !== 'html' && ! $this->frag) {
|
||||
$this->startTag('html');
|
||||
}
|
||||
|
||||
// Set quirks mode if we're at IM_INITIAL with no doctype.
|
||||
if ($this->insertMode == static::IM_INITIAL) {
|
||||
$this->quirks = true;
|
||||
$this->parseError("No DOCTYPE specified.");
|
||||
}
|
||||
|
||||
// SPECIAL TAG HANDLING:
|
||||
// Spec says do this, and "don't ask."
|
||||
if ($name == 'image') {
|
||||
$name = 'img';
|
||||
}
|
||||
|
||||
// Autoclose p tags where appropriate.
|
||||
if ($this->insertMode >= static::IM_IN_BODY && Elements::isA($name, Elements::AUTOCLOSE_P)) {
|
||||
$this->autoclose('p');
|
||||
}
|
||||
|
||||
// Set insert mode:
|
||||
switch ($name) {
|
||||
case 'html':
|
||||
$this->insertMode = static::IM_BEFORE_HEAD;
|
||||
break;
|
||||
case 'head':
|
||||
if ($this->insertMode > static::IM_BEFORE_HEAD) {
|
||||
$this->parseError("Unexpected head tag outside of head context.");
|
||||
} else {
|
||||
$this->insertMode = static::IM_IN_HEAD;
|
||||
}
|
||||
break;
|
||||
case 'body':
|
||||
$this->insertMode = static::IM_IN_BODY;
|
||||
break;
|
||||
case 'svg':
|
||||
$this->insertMode = static::IM_IN_SVG;
|
||||
break;
|
||||
case 'math':
|
||||
$this->insertMode = static::IM_IN_MATHML;
|
||||
break;
|
||||
case 'noscript':
|
||||
if ($this->insertMode == static::IM_IN_HEAD) {
|
||||
$this->insertMode = static::IM_IN_HEAD_NOSCRIPT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Special case handling for SVG.
|
||||
if ($this->insertMode == static::IM_IN_SVG) {
|
||||
$lname = Elements::normalizeSvgElement($lname);
|
||||
}
|
||||
|
||||
$pushes = 0;
|
||||
// when we found a tag thats appears inside $nsRoots, we have to switch the defalut namespace
|
||||
if (isset($this->nsRoots[$lname]) && $this->nsStack[0][''] !== $this->nsRoots[$lname]) {
|
||||
array_unshift($this->nsStack, array(
|
||||
'' => $this->nsRoots[$lname]
|
||||
) + $this->nsStack[0]);
|
||||
$pushes ++;
|
||||
}
|
||||
$needsWorkaround = false;
|
||||
if (isset($this->options["xmlNamespaces"]) && $this->options["xmlNamespaces"]) {
|
||||
// when xmlNamespaces is true a and we found a 'xmlns' or 'xmlns:*' attribute, we should add a new item to the $nsStack
|
||||
foreach ($attributes as $aName => $aVal) {
|
||||
if ($aName === 'xmlns') {
|
||||
$needsWorkaround = $aVal;
|
||||
array_unshift($this->nsStack, array(
|
||||
'' => $aVal
|
||||
) + $this->nsStack[0]);
|
||||
$pushes ++;
|
||||
} elseif ((($pos = strpos($aName, ':')) ? substr($aName, 0, $pos) : '') === 'xmlns') {
|
||||
array_unshift($this->nsStack, array(
|
||||
substr($aName, $pos + 1) => $aVal
|
||||
) + $this->nsStack[0]);
|
||||
$pushes ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->onlyInline && Elements::isA($lname, Elements::BLOCK_TAG)) {
|
||||
$this->autoclose($this->onlyInline);
|
||||
$this->onlyInline = null;
|
||||
}
|
||||
|
||||
try {
|
||||
$prefix = ($pos = strpos($lname, ':')) ? substr($lname, 0, $pos) : '';
|
||||
|
||||
|
||||
if ($needsWorkaround!==false) {
|
||||
|
||||
$xml = "<$lname xmlns=\"$needsWorkaround\" ".(strlen($prefix) && isset($this->nsStack[0][$prefix])?("xmlns:$prefix=\"".$this->nsStack[0][$prefix]."\""):"")."/>";
|
||||
|
||||
$frag = new \DOMDocument('1.0', 'UTF-8');
|
||||
$frag->loadXML($xml);
|
||||
|
||||
$ele = $this->doc->importNode($frag->documentElement, true);
|
||||
|
||||
} else {
|
||||
if (!isset($this->nsStack[0][$prefix]) || ($prefix === "" && isset($this->options[self::OPT_DISABLE_HTML_NS]) && $this->options[self::OPT_DISABLE_HTML_NS])) {
|
||||
$ele = $this->doc->createElement($lname);
|
||||
} else {
|
||||
$ele = $this->doc->createElementNS($this->nsStack[0][$prefix], $lname);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (\DOMException $e) {
|
||||
$this->parseError("Illegal tag name: <$lname>. Replaced with <invalid>.");
|
||||
$ele = $this->doc->createElement('invalid');
|
||||
}
|
||||
|
||||
if (Elements::isA($lname, Elements::BLOCK_ONLY_INLINE)) {
|
||||
$this->onlyInline = $lname;
|
||||
}
|
||||
|
||||
// When we add some namespacess, we have to track them. Later, when "endElement" is invoked, we have to remove them.
|
||||
// When we are on a void tag, we do not need to care about namesapce nesting.
|
||||
if ($pushes > 0 && !Elements::isA($name, Elements::VOID_TAG)) {
|
||||
// PHP tends to free the memory used by DOM,
|
||||
// to avoid spl_object_hash collisions whe have to avoid garbage collection of $ele storing it into $pushes
|
||||
// see https://bugs.php.net/bug.php?id=67459
|
||||
$this->pushes[spl_object_hash($ele)] = array($pushes, $ele);
|
||||
|
||||
// SEE https://github.com/facebook/hhvm/issues/2962
|
||||
if (defined('HHVM_VERSION')) {
|
||||
$ele->setAttribute('html5-php-fake-id-attribute', spl_object_hash($ele));
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($attributes as $aName => $aVal) {
|
||||
// xmlns attributes can't be set
|
||||
if ($aName === 'xmlns') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($this->insertMode == static::IM_IN_SVG) {
|
||||
$aName = Elements::normalizeSvgAttribute($aName);
|
||||
} elseif ($this->insertMode == static::IM_IN_MATHML) {
|
||||
$aName = Elements::normalizeMathMlAttribute($aName);
|
||||
}
|
||||
|
||||
try {
|
||||
$prefix = ($pos = strpos($aName, ':')) ? substr($aName, 0, $pos) : false;
|
||||
|
||||
if ($prefix==='xmlns') {
|
||||
$ele->setAttributeNs(self::NAMESPACE_XMLNS, $aName, $aVal);
|
||||
} elseif ($prefix!==false && isset($this->nsStack[0][$prefix])) {
|
||||
$ele->setAttributeNs($this->nsStack[0][$prefix], $aName, $aVal);
|
||||
} else {
|
||||
$ele->setAttribute($aName, $aVal);
|
||||
}
|
||||
} catch (\DOMException $e) {
|
||||
$this->parseError("Illegal attribute name for tag $name. Ignoring: $aName");
|
||||
continue;
|
||||
}
|
||||
|
||||
// This is necessary on a non-DTD schema, like HTML5.
|
||||
if ($aName == 'id') {
|
||||
$ele->setIdAttribute('id', true);
|
||||
}
|
||||
}
|
||||
|
||||
// Some elements have special processing rules. Handle those separately.
|
||||
if ($this->rules->hasRules($name) && $this->frag !== $this->current) {
|
||||
$this->current = $this->rules->evaluate($ele, $this->current);
|
||||
} // Otherwise, it's a standard element.
|
||||
else {
|
||||
$this->current->appendChild($ele);
|
||||
|
||||
// XXX: Need to handle self-closing tags and unary tags.
|
||||
if (! Elements::isA($name, Elements::VOID_TAG)) {
|
||||
$this->current = $ele;
|
||||
}
|
||||
}
|
||||
|
||||
// This is sort of a last-ditch attempt to correct for cases where no head/body
|
||||
// elements are provided.
|
||||
if ($this->insertMode <= static::IM_BEFORE_HEAD && $name != 'head' && $name != 'html') {
|
||||
$this->insertMode = static::IM_IN_BODY;
|
||||
}
|
||||
|
||||
// When we are on a void tag, we do not need to care about namesapce nesting,
|
||||
// but we have to remove the namespaces pushed to $nsStack.
|
||||
if ($pushes > 0 && Elements::isA($name, Elements::VOID_TAG)) {
|
||||
// remove the namespaced definded by current node
|
||||
for ($i = 0; $i < $pushes; $i ++) {
|
||||
array_shift($this->nsStack);
|
||||
}
|
||||
}
|
||||
// Return the element mask, which the tokenizer can then use to set
|
||||
// various processing rules.
|
||||
return Elements::element($name);
|
||||
}
|
||||
|
||||
public function endTag($name)
|
||||
{
|
||||
$lname = $this->normalizeTagName($name);
|
||||
|
||||
// Ignore closing tags for unary elements.
|
||||
if (Elements::isA($name, Elements::VOID_TAG)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->insertMode <= static::IM_BEFORE_HTML) {
|
||||
// 8.2.5.4.2
|
||||
if (in_array($name, array(
|
||||
'html',
|
||||
'br',
|
||||
'head',
|
||||
'title'
|
||||
))) {
|
||||
$this->startTag('html');
|
||||
$this->endTag($name);
|
||||
$this->insertMode = static::IM_BEFORE_HEAD;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Ignore the tag.
|
||||
$this->parseError("Illegal closing tag at global scope.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Special case handling for SVG.
|
||||
if ($this->insertMode == static::IM_IN_SVG) {
|
||||
$lname = Elements::normalizeSvgElement($lname);
|
||||
}
|
||||
|
||||
// See https://github.com/facebook/hhvm/issues/2962
|
||||
if (defined('HHVM_VERSION') && ($cid = $this->current->getAttribute('html5-php-fake-id-attribute'))) {
|
||||
$this->current->removeAttribute('html5-php-fake-id-attribute');
|
||||
} else {
|
||||
$cid = spl_object_hash($this->current);
|
||||
}
|
||||
|
||||
// XXX: Not sure whether we need this anymore.
|
||||
// if ($name != $lname) {
|
||||
// return $this->quirksTreeResolver($lname);
|
||||
// }
|
||||
|
||||
// XXX: HTML has no parent. What do we do, though,
|
||||
// if this element appears in the wrong place?
|
||||
if ($lname == 'html') {
|
||||
return;
|
||||
}
|
||||
|
||||
// remove the namespaced definded by current node
|
||||
if (isset($this->pushes[$cid])) {
|
||||
for ($i = 0; $i < $this->pushes[$cid][0]; $i ++) {
|
||||
array_shift($this->nsStack);
|
||||
}
|
||||
unset($this->pushes[$cid]);
|
||||
}
|
||||
|
||||
if (! $this->autoclose($lname)) {
|
||||
$this->parseError('Could not find closing tag for ' . $lname);
|
||||
}
|
||||
|
||||
// switch ($this->insertMode) {
|
||||
switch ($lname) {
|
||||
case "head":
|
||||
$this->insertMode = static::IM_AFTER_HEAD;
|
||||
break;
|
||||
case "body":
|
||||
$this->insertMode = static::IM_AFTER_BODY;
|
||||
break;
|
||||
case "svg":
|
||||
case "mathml":
|
||||
$this->insertMode = static::IM_IN_BODY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function comment($cdata)
|
||||
{
|
||||
// TODO: Need to handle case where comment appears outside of the HTML tag.
|
||||
$node = $this->doc->createComment($cdata);
|
||||
$this->current->appendChild($node);
|
||||
}
|
||||
|
||||
public function text($data)
|
||||
{
|
||||
// XXX: Hmmm.... should we really be this strict?
|
||||
if ($this->insertMode < static::IM_IN_HEAD) {
|
||||
// Per '8.2.5.4.3 The "before head" insertion mode' the characters
|
||||
// " \t\n\r\f" should be ignored but no mention of a parse error. This is
|
||||
// practical as most documents contain these characters. Other text is not
|
||||
// expected here so recording a parse error is necessary.
|
||||
$dataTmp = trim($data, " \t\n\r\f");
|
||||
if (! empty($dataTmp)) {
|
||||
// fprintf(STDOUT, "Unexpected insert mode: %d", $this->insertMode);
|
||||
$this->parseError("Unexpected text. Ignoring: " . $dataTmp);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
// fprintf(STDOUT, "Appending text %s.", $data);
|
||||
$node = $this->doc->createTextNode($data);
|
||||
$this->current->appendChild($node);
|
||||
}
|
||||
|
||||
public function eof()
|
||||
{
|
||||
// If the $current isn't the $root, do we need to do anything?
|
||||
}
|
||||
|
||||
public function parseError($msg, $line = 0, $col = 0)
|
||||
{
|
||||
$this->errors[] = sprintf("Line %d, Col %d: %s", $line, $col, $msg);
|
||||
}
|
||||
|
||||
public function getErrors()
|
||||
{
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
public function cdata($data)
|
||||
{
|
||||
$node = $this->doc->createCDATASection($data);
|
||||
$this->current->appendChild($node);
|
||||
}
|
||||
|
||||
public function processingInstruction($name, $data = null)
|
||||
{
|
||||
// XXX: Ignore initial XML declaration, per the spec.
|
||||
if ($this->insertMode == static::IM_INITIAL && 'xml' == strtolower($name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Important: The processor may modify the current DOM tree however
|
||||
// it sees fit.
|
||||
if (isset($this->processor)) {
|
||||
$res = $this->processor->process($this->current, $name, $data);
|
||||
if (! empty($res)) {
|
||||
$this->current = $res;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Otherwise, this is just a dumb PI element.
|
||||
$node = $this->doc->createProcessingInstruction($name, $data);
|
||||
|
||||
$this->current->appendChild($node);
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
// UTILITIES
|
||||
// ==========================================================================
|
||||
|
||||
/**
|
||||
* Apply normalization rules to a tag name.
|
||||
*
|
||||
* See sections 2.9 and 8.1.2.
|
||||
*
|
||||
* @param string $name
|
||||
* The tag name.
|
||||
* @return string The normalized tag name.
|
||||
*/
|
||||
protected function normalizeTagName($name)
|
||||
{
|
||||
/*
|
||||
* Section 2.9 suggests that we should not do this. if (strpos($name, ':') !== false) { // We know from the grammar that there must be at least one other // char besides :, since : is not a legal tag start. $parts = explode(':', $name); return array_pop($parts); }
|
||||
*/
|
||||
return $name;
|
||||
}
|
||||
|
||||
protected function quirksTreeResolver($name)
|
||||
{
|
||||
throw new \Exception("Not implemented.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Automatically climb the tree and close the closest node with the matching $tag.
|
||||
*/
|
||||
protected function autoclose($tag)
|
||||
{
|
||||
$working = $this->current;
|
||||
do {
|
||||
if ($working->nodeType != XML_ELEMENT_NODE) {
|
||||
return false;
|
||||
}
|
||||
if ($working->tagName == $tag) {
|
||||
$this->current = $working->parentNode;
|
||||
|
||||
return true;
|
||||
}
|
||||
} while ($working = $working->parentNode);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given tagname is an ancestor of the present candidate.
|
||||
*
|
||||
* If $this->current or anything above $this->current matches the given tag
|
||||
* name, this returns true.
|
||||
*/
|
||||
protected function isAncestor($tagname)
|
||||
{
|
||||
$candidate = $this->current;
|
||||
while ($candidate->nodeType === XML_ELEMENT_NODE) {
|
||||
if ($candidate->tagName == $tagname) {
|
||||
return true;
|
||||
}
|
||||
$candidate = $candidate->parentNode;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the immediate parent element is of the given tagname.
|
||||
*/
|
||||
protected function isParent($tagname)
|
||||
{
|
||||
return $this->current->tagName == $tagname;
|
||||
}
|
||||
}
|
||||
122
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/EventHandler.php
vendored
Normal file
122
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/EventHandler.php
vendored
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
<?php
|
||||
namespace Masterminds\HTML5\Parser;
|
||||
|
||||
/**
|
||||
* Standard events for HTML5.
|
||||
*
|
||||
* This is roughly analogous to a SAX2 or expat-style interface.
|
||||
* However, it is tuned specifically for HTML5, according to section 8
|
||||
* of the HTML5 specification.
|
||||
*
|
||||
* An event handler receives parser events. For a concrete
|
||||
* implementation, see DOMTreeBuilder.
|
||||
*
|
||||
* Quirks support in the parser is limited to close-in syntax (malformed
|
||||
* tags or attributes). Higher order syntax and semantic issues with a
|
||||
* document (e.g. mismatched tags, illegal nesting, etc.) are the
|
||||
* responsibility of the event handler implementation.
|
||||
*
|
||||
* See HTML5 spec section 8.2.4
|
||||
*/
|
||||
interface EventHandler
|
||||
{
|
||||
|
||||
const DOCTYPE_NONE = 0;
|
||||
|
||||
const DOCTYPE_PUBLIC = 1;
|
||||
|
||||
const DOCTYPE_SYSTEM = 2;
|
||||
|
||||
/**
|
||||
* A doctype declaration.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the root element.
|
||||
* @param int $idType
|
||||
* One of DOCTYPE_NONE, DOCTYPE_PUBLIC, or DOCTYPE_SYSTEM.
|
||||
* @param string $id
|
||||
* The identifier. For DOCTYPE_PUBLIC, this is the public ID. If DOCTYPE_SYSTEM,
|
||||
* then this is a system ID.
|
||||
* @param boolean $quirks
|
||||
* Indicates whether the builder should enter quirks mode.
|
||||
*/
|
||||
public function doctype($name, $idType = 0, $id = null, $quirks = false);
|
||||
|
||||
/**
|
||||
* A start tag.
|
||||
*
|
||||
* IMPORTANT: The parser watches the return value of this event. If this returns
|
||||
* an integer, the parser will switch TEXTMODE patters according to the int.
|
||||
*
|
||||
* This is how the Tree Builder can tell the Tokenizer when a certain tag should
|
||||
* cause the parser to go into RAW text mode.
|
||||
*
|
||||
* The HTML5 standard requires that the builder is the one that initiates this
|
||||
* step, and this is the only way short of a circular reference that we can
|
||||
* do that.
|
||||
*
|
||||
* Example: if a startTag even for a `script` name is fired, and the startTag()
|
||||
* implementation returns Tokenizer::TEXTMODE_RAW, then the tokenizer will
|
||||
* switch into RAW text mode and consume data until it reaches a closing
|
||||
* `script` tag.
|
||||
*
|
||||
* The textmode is automatically reset to Tokenizer::TEXTMODE_NORMAL when the
|
||||
* closing tag is encounter. **This behavior may change.**
|
||||
*
|
||||
* @param string $name
|
||||
* The tag name.
|
||||
* @param array $attributes
|
||||
* An array with all of the tag's attributes.
|
||||
* @param boolean $selfClosing
|
||||
* An indicator of whether or not this tag is self-closing (<foo/>)
|
||||
* @return int One of the Tokenizer::TEXTMODE_* constants.
|
||||
*/
|
||||
public function startTag($name, $attributes = array(), $selfClosing = false);
|
||||
|
||||
/**
|
||||
* An end-tag.
|
||||
*/
|
||||
public function endTag($name);
|
||||
|
||||
/**
|
||||
* A comment section (unparsed character data).
|
||||
*/
|
||||
public function comment($cdata);
|
||||
|
||||
/**
|
||||
* A unit of parsed character data.
|
||||
*
|
||||
* Entities in this text are *already decoded*.
|
||||
*/
|
||||
public function text($cdata);
|
||||
|
||||
/**
|
||||
* Indicates that the document has been entirely processed.
|
||||
*/
|
||||
public function eof();
|
||||
|
||||
/**
|
||||
* Emitted when the parser encounters an error condition.
|
||||
*/
|
||||
public function parseError($msg, $line, $col);
|
||||
|
||||
/**
|
||||
* A CDATA section.
|
||||
*
|
||||
* @param string $data
|
||||
* The unparsed character data.
|
||||
*/
|
||||
public function cdata($data);
|
||||
|
||||
/**
|
||||
* This is a holdover from the XML spec.
|
||||
*
|
||||
* While user agents don't get PIs, server-side does.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the processor (e.g. 'php').
|
||||
* @param string $data
|
||||
* The unparsed data.
|
||||
*/
|
||||
public function processingInstruction($name, $data = null);
|
||||
}
|
||||
32
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/FileInputStream.php
vendored
Normal file
32
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/FileInputStream.php
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
namespace Masterminds\HTML5\Parser;
|
||||
|
||||
/**
|
||||
* The FileInputStream loads a file to be parsed.
|
||||
*
|
||||
* So right now we read files into strings and then process the
|
||||
* string. We chose to do this largely for the sake of expediency of
|
||||
* development, and also because we could optimize toward processing
|
||||
* arbitrarily large chunks of the input. But in the future, we'd
|
||||
* really like to rewrite this class to efficiently handle lower level
|
||||
* stream reads (and thus efficiently handle large documents).
|
||||
*
|
||||
* @todo A buffered input stream would be useful.
|
||||
*/
|
||||
class FileInputStream extends StringInputStream implements InputStream
|
||||
{
|
||||
|
||||
/**
|
||||
* Load a file input stream.
|
||||
*
|
||||
* @param string $data
|
||||
* The file or url path to load.
|
||||
*/
|
||||
public function __construct($data, $encoding = 'UTF-8', $debug = '')
|
||||
{
|
||||
// Get the contents of the file.
|
||||
$content = file_get_contents($data);
|
||||
|
||||
parent::__construct($content, $encoding, $debug);
|
||||
}
|
||||
}
|
||||
87
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/InputStream.php
vendored
Normal file
87
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/InputStream.php
vendored
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
<?php
|
||||
namespace Masterminds\HTML5\Parser;
|
||||
|
||||
/**
|
||||
* Interface for stream readers.
|
||||
*
|
||||
* The parser only reads from streams. Various input sources can write
|
||||
* an adapater to this InputStream.
|
||||
*
|
||||
* Currently provided InputStream implementations include
|
||||
* FileInputStream and StringInputStream.
|
||||
*/
|
||||
interface InputStream extends \Iterator
|
||||
{
|
||||
|
||||
/**
|
||||
* Returns the current line that is being consumed.
|
||||
*
|
||||
* TODO: Move this to the scanner.
|
||||
*/
|
||||
public function currentLine();
|
||||
|
||||
/**
|
||||
* Returns the current column of the current line that the tokenizer is at.
|
||||
*
|
||||
* Newlines are column 0. The first char after a newline is column 1.
|
||||
*
|
||||
* @TODO Move this to the scanner.
|
||||
*
|
||||
* @return int The column number.
|
||||
*/
|
||||
public function columnOffset();
|
||||
|
||||
/**
|
||||
* Get all characters until EOF.
|
||||
*
|
||||
* This consumes characters until the EOF.
|
||||
*/
|
||||
public function remainingChars();
|
||||
|
||||
/**
|
||||
* Read to a particular match (or until $max bytes are consumed).
|
||||
*
|
||||
* This operates on byte sequences, not characters.
|
||||
*
|
||||
* Matches as far as possible until we reach a certain set of bytes
|
||||
* and returns the matched substring.
|
||||
*
|
||||
* @see strcspn
|
||||
* @param string $bytes
|
||||
* Bytes to match.
|
||||
* @param int $max
|
||||
* Maximum number of bytes to scan.
|
||||
* @return mixed Index or false if no match is found. You should use strong
|
||||
* equality when checking the result, since index could be 0.
|
||||
*/
|
||||
public function charsUntil($bytes, $max = null);
|
||||
|
||||
/**
|
||||
* Returns the string so long as $bytes matches.
|
||||
*
|
||||
* Matches as far as possible with a certain set of bytes
|
||||
* and returns the matched substring.
|
||||
*
|
||||
* @see strspn
|
||||
* @param string $bytes
|
||||
* A mask of bytes to match. If ANY byte in this mask matches the
|
||||
* current char, the pointer advances and the char is part of the
|
||||
* substring.
|
||||
* @param int $max
|
||||
* The max number of chars to read.
|
||||
*/
|
||||
public function charsWhile($bytes, $max = null);
|
||||
|
||||
/**
|
||||
* Unconsume one character.
|
||||
*
|
||||
* @param int $howMany
|
||||
* The number of characters to move the pointer back.
|
||||
*/
|
||||
public function unconsume($howMany = 1);
|
||||
|
||||
/**
|
||||
* Retrieve the next character without advancing the pointer.
|
||||
*/
|
||||
public function peek();
|
||||
}
|
||||
9
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/ParseError.php
vendored
Normal file
9
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/ParseError.php
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Masterminds\HTML5\Parser;
|
||||
|
||||
/**
|
||||
* Emit when the parser has an error.
|
||||
*/
|
||||
class ParseError extends \Exception
|
||||
{
|
||||
}
|
||||
53
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/README.md
vendored
Normal file
53
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/README.md
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# The Parser Model
|
||||
|
||||
The parser model here follows the model in section
|
||||
[8.2.1](http://www.w3.org/TR/2012/CR-html5-20121217/syntax.html#parsing)
|
||||
of the HTML5 specification, though we do not assume a networking layer.
|
||||
|
||||
[ InputStream ] // Generic support for reading input.
|
||||
||
|
||||
[ Scanner ] // Breaks down the stream into characters.
|
||||
||
|
||||
[ Tokenizer ] // Groups characters into syntactic
|
||||
||
|
||||
[ Tree Builder ] // Organizes units into a tree of objects
|
||||
||
|
||||
[ DOM Document ] // The final state of the parsed document.
|
||||
|
||||
|
||||
## InputStream
|
||||
|
||||
This is an interface with at least two concrete implementations:
|
||||
|
||||
- StringInputStream: Reads an HTML5 string.
|
||||
- FileInputStream: Reads an HTML5 file.
|
||||
|
||||
## Scanner
|
||||
|
||||
This is a mechanical piece of the parser.
|
||||
|
||||
## Tokenizer
|
||||
|
||||
This follows section 8.4 of the HTML5 spec. It is (roughly) a recursive
|
||||
descent parser. (Though there are plenty of optimizations that are less
|
||||
than purely functional.
|
||||
|
||||
## EventHandler and DOMTree
|
||||
|
||||
EventHandler is the interface for tree builders. Since not all
|
||||
implementations will necessarily build trees, we've chosen a more
|
||||
generic name.
|
||||
|
||||
The event handler emits tokens during tokenization.
|
||||
|
||||
The DOMTree is an event handler that builds a DOM tree. The output of
|
||||
the DOMTree builder is a DOMDocument.
|
||||
|
||||
## DOMDocument
|
||||
|
||||
PHP has a DOMDocument class built-in (technically, it's part of libxml.)
|
||||
We use that, thus rendering the output of this process compatible with
|
||||
SimpleXML, QueryPath, and many other XML/HTML processing tools.
|
||||
|
||||
For cases where the HTML5 is a fragment of a HTML5 document a
|
||||
DOMDocumentFragment is returned instead. This is another built-in class.
|
||||
222
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/Scanner.php
vendored
Normal file
222
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/Scanner.php
vendored
Normal file
|
|
@ -0,0 +1,222 @@
|
|||
<?php
|
||||
namespace Masterminds\HTML5\Parser;
|
||||
|
||||
/**
|
||||
* The scanner.
|
||||
*
|
||||
* This scans over an input stream.
|
||||
*/
|
||||
class Scanner
|
||||
{
|
||||
|
||||
const CHARS_HEX = 'abcdefABCDEF01234567890';
|
||||
|
||||
const CHARS_ALNUM = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890';
|
||||
|
||||
const CHARS_ALPHA = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
|
||||
protected $is;
|
||||
|
||||
// Flipping this to true will give minisculely more debugging info.
|
||||
public $debug = false;
|
||||
|
||||
/**
|
||||
* Create a new Scanner.
|
||||
*
|
||||
* @param \Masterminds\HTML5\Parser\InputStream $input
|
||||
* An InputStream to be scanned.
|
||||
*/
|
||||
public function __construct($input)
|
||||
{
|
||||
$this->is = $input;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current position.
|
||||
*
|
||||
* @return int The current intiger byte position.
|
||||
*/
|
||||
public function position()
|
||||
{
|
||||
return $this->is->key();
|
||||
}
|
||||
|
||||
/**
|
||||
* Take a peek at the next character in the data.
|
||||
*
|
||||
* @return string The next character.
|
||||
*/
|
||||
public function peek()
|
||||
{
|
||||
return $this->is->peek();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next character.
|
||||
*
|
||||
* Note: This advances the pointer.
|
||||
*
|
||||
* @return string The next character.
|
||||
*/
|
||||
public function next()
|
||||
{
|
||||
$this->is->next();
|
||||
if ($this->is->valid()) {
|
||||
if ($this->debug)
|
||||
fprintf(STDOUT, "> %s\n", $this->is->current());
|
||||
return $this->is->current();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current character.
|
||||
*
|
||||
* Note, this does not advance the pointer.
|
||||
*
|
||||
* @return string The current character.
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
if ($this->is->valid()) {
|
||||
return $this->is->current();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Silently consume N chars.
|
||||
*/
|
||||
public function consume($count = 1)
|
||||
{
|
||||
for ($i = 0; $i < $count; ++ $i) {
|
||||
$this->next();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unconsume some of the data.
|
||||
* This moves the data pointer backwards.
|
||||
*
|
||||
* @param int $howMany
|
||||
* The number of characters to move the pointer back.
|
||||
*/
|
||||
public function unconsume($howMany = 1)
|
||||
{
|
||||
$this->is->unconsume($howMany);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next group of that contains hex characters.
|
||||
*
|
||||
* Note, along with getting the characters the pointer in the data will be
|
||||
* moved as well.
|
||||
*
|
||||
* @return string The next group that is hex characters.
|
||||
*/
|
||||
public function getHex()
|
||||
{
|
||||
return $this->is->charsWhile(static::CHARS_HEX);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next group of characters that are ASCII Alpha characters.
|
||||
*
|
||||
* Note, along with getting the characters the pointer in the data will be
|
||||
* moved as well.
|
||||
*
|
||||
* @return string The next group of ASCII alpha characters.
|
||||
*/
|
||||
public function getAsciiAlpha()
|
||||
{
|
||||
return $this->is->charsWhile(static::CHARS_ALPHA);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next group of characters that are ASCII Alpha characters and numbers.
|
||||
*
|
||||
* Note, along with getting the characters the pointer in the data will be
|
||||
* moved as well.
|
||||
*
|
||||
* @return string The next group of ASCII alpha characters and numbers.
|
||||
*/
|
||||
public function getAsciiAlphaNum()
|
||||
{
|
||||
return $this->is->charsWhile(static::CHARS_ALNUM);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next group of numbers.
|
||||
*
|
||||
* Note, along with getting the characters the pointer in the data will be
|
||||
* moved as well.
|
||||
*
|
||||
* @return string The next group of numbers.
|
||||
*/
|
||||
public function getNumeric()
|
||||
{
|
||||
return $this->is->charsWhile('0123456789');
|
||||
}
|
||||
|
||||
/**
|
||||
* Consume whitespace.
|
||||
*
|
||||
* Whitespace in HTML5 is: formfeed, tab, newline, space.
|
||||
*/
|
||||
public function whitespace()
|
||||
{
|
||||
return $this->is->charsWhile("\n\t\f ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current line that is being consumed.
|
||||
*
|
||||
* @return int The current line number.
|
||||
*/
|
||||
public function currentLine()
|
||||
{
|
||||
return $this->is->currentLine();
|
||||
}
|
||||
|
||||
/**
|
||||
* Read chars until something in the mask is encountered.
|
||||
*/
|
||||
public function charsUntil($mask)
|
||||
{
|
||||
return $this->is->charsUntil($mask);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read chars as long as the mask matches.
|
||||
*/
|
||||
public function charsWhile($mask)
|
||||
{
|
||||
return $this->is->charsWhile($mask);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current column of the current line that the tokenizer is at.
|
||||
*
|
||||
* Newlines are column 0. The first char after a newline is column 1.
|
||||
*
|
||||
* @return int The column number.
|
||||
*/
|
||||
public function columnOffset()
|
||||
{
|
||||
return $this->is->columnOffset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all characters until EOF.
|
||||
*
|
||||
* This consumes characters until the EOF.
|
||||
*
|
||||
* @return int The number of characters remaining.
|
||||
*/
|
||||
public function remainingChars()
|
||||
{
|
||||
return $this->is->remainingChars();
|
||||
}
|
||||
}
|
||||
331
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/StringInputStream.php
vendored
Normal file
331
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/StringInputStream.php
vendored
Normal file
|
|
@ -0,0 +1,331 @@
|
|||
<?php
|
||||
/**
|
||||
* Loads a string to be parsed.
|
||||
*/
|
||||
namespace Masterminds\HTML5\Parser;
|
||||
|
||||
/*
|
||||
*
|
||||
* Based on code from html5lib:
|
||||
|
||||
Copyright 2009 Geoffrey Sneddon <http://gsnedders.com/>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS 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.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
// Some conventions:
|
||||
// - /* */ indicates verbatim text from the HTML 5 specification
|
||||
// MPB: Not sure which version of the spec. Moving from HTML5lib to
|
||||
// HTML5-PHP, I have been using this version:
|
||||
// http://www.w3.org/TR/2012/CR-html5-20121217/Overview.html#contents
|
||||
//
|
||||
// - // indicates regular comments
|
||||
|
||||
class StringInputStream implements InputStream
|
||||
{
|
||||
|
||||
/**
|
||||
* The string data we're parsing.
|
||||
*/
|
||||
private $data;
|
||||
|
||||
/**
|
||||
* The current integer byte position we are in $data
|
||||
*/
|
||||
private $char;
|
||||
|
||||
/**
|
||||
* Length of $data; when $char === $data, we are at the end-of-file.
|
||||
*/
|
||||
private $EOF;
|
||||
|
||||
/**
|
||||
* Parse errors.
|
||||
*/
|
||||
public $errors = array();
|
||||
|
||||
/**
|
||||
* Create a new InputStream wrapper.
|
||||
*
|
||||
* @param $data Data
|
||||
* to parse
|
||||
*/
|
||||
public function __construct($data, $encoding = 'UTF-8', $debug = '')
|
||||
{
|
||||
$data = UTF8Utils::convertToUTF8($data, $encoding);
|
||||
if ($debug)
|
||||
fprintf(STDOUT, $debug, $data, strlen($data));
|
||||
|
||||
// There is good reason to question whether it makes sense to
|
||||
// do this here, since most of these checks are done during
|
||||
// parsing, and since this check doesn't actually *do* anything.
|
||||
$this->errors = UTF8Utils::checkForIllegalCodepoints($data);
|
||||
// if (!empty($e)) {
|
||||
// throw new ParseError("UTF-8 encoding issues: " . implode(', ', $e));
|
||||
// }
|
||||
|
||||
$data = $this->replaceLinefeeds($data);
|
||||
|
||||
$this->data = $data;
|
||||
$this->char = 0;
|
||||
$this->EOF = strlen($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace linefeed characters according to the spec.
|
||||
*/
|
||||
protected function replaceLinefeeds($data)
|
||||
{
|
||||
/*
|
||||
* U+000D CARRIAGE RETURN (CR) characters and U+000A LINE FEED (LF) characters are treated specially. Any CR characters that are followed by LF characters must be removed, and any CR characters not followed by LF characters must be converted to LF characters. Thus, newlines in HTML DOMs are represented by LF characters, and there are never any CR characters in the input to the tokenization stage.
|
||||
*/
|
||||
$crlfTable = array(
|
||||
"\0" => "\xEF\xBF\xBD",
|
||||
"\r\n" => "\n",
|
||||
"\r" => "\n"
|
||||
);
|
||||
|
||||
return strtr($data, $crlfTable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current line that the tokenizer is at.
|
||||
*/
|
||||
public function currentLine()
|
||||
{
|
||||
if (empty($this->EOF) || $this->char == 0) {
|
||||
return 1;
|
||||
}
|
||||
// Add one to $this->char because we want the number for the next
|
||||
// byte to be processed.
|
||||
return substr_count($this->data, "\n", 0, min($this->char, $this->EOF)) + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
*/
|
||||
public function getCurrentLine()
|
||||
{
|
||||
return currentLine();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current column of the current line that the tokenizer is at.
|
||||
*
|
||||
* Newlines are column 0. The first char after a newline is column 1.
|
||||
*
|
||||
* @return int The column number.
|
||||
*/
|
||||
public function columnOffset()
|
||||
{
|
||||
// Short circuit for the first char.
|
||||
if ($this->char == 0) {
|
||||
return 0;
|
||||
}
|
||||
// strrpos is weird, and the offset needs to be negative for what we
|
||||
// want (i.e., the last \n before $this->char). This needs to not have
|
||||
// one (to make it point to the next character, the one we want the
|
||||
// position of) added to it because strrpos's behaviour includes the
|
||||
// final offset byte.
|
||||
$backwardFrom = $this->char - 1 - strlen($this->data);
|
||||
$lastLine = strrpos($this->data, "\n", $backwardFrom);
|
||||
|
||||
// However, for here we want the length up until the next byte to be
|
||||
// processed, so add one to the current byte ($this->char).
|
||||
if ($lastLine !== false) {
|
||||
$findLengthOf = substr($this->data, $lastLine + 1, $this->char - 1 - $lastLine);
|
||||
} else {
|
||||
// After a newline.
|
||||
$findLengthOf = substr($this->data, 0, $this->char);
|
||||
}
|
||||
|
||||
return UTF8Utils::countChars($findLengthOf);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
*/
|
||||
public function getColumnOffset()
|
||||
{
|
||||
return $this->columnOffset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current character.
|
||||
*
|
||||
* @return string The current character.
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
return $this->data[$this->char];
|
||||
}
|
||||
|
||||
/**
|
||||
* Advance the pointer.
|
||||
* This is part of the Iterator interface.
|
||||
*/
|
||||
public function next()
|
||||
{
|
||||
$this->char ++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rewind to the start of the string.
|
||||
*/
|
||||
public function rewind()
|
||||
{
|
||||
$this->char = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the current pointer location valid.
|
||||
*
|
||||
* @return bool Is the current pointer location valid.
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
if ($this->char < $this->EOF) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all characters until EOF.
|
||||
*
|
||||
* This reads to the end of the file, and sets the read marker at the
|
||||
* end of the file.
|
||||
*
|
||||
* @note This performs bounds checking
|
||||
*
|
||||
* @return string Returns the remaining text. If called when the InputStream is
|
||||
* already exhausted, it returns an empty string.
|
||||
*/
|
||||
public function remainingChars()
|
||||
{
|
||||
if ($this->char < $this->EOF) {
|
||||
$data = substr($this->data, $this->char);
|
||||
$this->char = $this->EOF;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
return ''; // false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read to a particular match (or until $max bytes are consumed).
|
||||
*
|
||||
* This operates on byte sequences, not characters.
|
||||
*
|
||||
* Matches as far as possible until we reach a certain set of bytes
|
||||
* and returns the matched substring.
|
||||
*
|
||||
* @param string $bytes
|
||||
* Bytes to match.
|
||||
* @param int $max
|
||||
* Maximum number of bytes to scan.
|
||||
* @return mixed Index or false if no match is found. You should use strong
|
||||
* equality when checking the result, since index could be 0.
|
||||
*/
|
||||
public function charsUntil($bytes, $max = null)
|
||||
{
|
||||
if ($this->char >= $this->EOF) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($max === 0 || $max) {
|
||||
$len = strcspn($this->data, $bytes, $this->char, $max);
|
||||
} else {
|
||||
$len = strcspn($this->data, $bytes, $this->char);
|
||||
}
|
||||
|
||||
$string = (string) substr($this->data, $this->char, $len);
|
||||
$this->char += $len;
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string so long as $bytes matches.
|
||||
*
|
||||
* Matches as far as possible with a certain set of bytes
|
||||
* and returns the matched substring.
|
||||
*
|
||||
* @param string $bytes
|
||||
* A mask of bytes to match. If ANY byte in this mask matches the
|
||||
* current char, the pointer advances and the char is part of the
|
||||
* substring.
|
||||
* @param int $max
|
||||
* The max number of chars to read.
|
||||
*/
|
||||
public function charsWhile($bytes, $max = null)
|
||||
{
|
||||
if ($this->char >= $this->EOF) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($max === 0 || $max) {
|
||||
$len = strspn($this->data, $bytes, $this->char, $max);
|
||||
} else {
|
||||
$len = strspn($this->data, $bytes, $this->char);
|
||||
}
|
||||
$string = (string) substr($this->data, $this->char, $len);
|
||||
$this->char += $len;
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unconsume characters.
|
||||
*
|
||||
* @param int $howMany
|
||||
* The number of characters to unconsume.
|
||||
*/
|
||||
public function unconsume($howMany = 1)
|
||||
{
|
||||
if (($this->char - $howMany) >= 0) {
|
||||
$this->char = $this->char - $howMany;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Look ahead without moving cursor.
|
||||
*/
|
||||
public function peek()
|
||||
{
|
||||
if (($this->char + 1) <= $this->EOF) {
|
||||
return $this->data[$this->char + 1];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function key()
|
||||
{
|
||||
return $this->char;
|
||||
}
|
||||
}
|
||||
1098
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/Tokenizer.php
vendored
Normal file
1098
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/Tokenizer.php
vendored
Normal file
File diff suppressed because it is too large
Load diff
140
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/TreeBuildingRules.php
vendored
Normal file
140
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/TreeBuildingRules.php
vendored
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
<?php
|
||||
namespace Masterminds\HTML5\Parser;
|
||||
|
||||
/**
|
||||
* Handles special-case rules for the DOM tree builder.
|
||||
*
|
||||
* Many tags have special rules that need to be accomodated on an
|
||||
* individual basis. This class handles those rules.
|
||||
*
|
||||
* See section 8.1.2.4 of the spec.
|
||||
*
|
||||
* @todo - colgroup and col special behaviors
|
||||
* - body and head special behaviors
|
||||
*/
|
||||
class TreeBuildingRules
|
||||
{
|
||||
|
||||
protected static $tags = array(
|
||||
'li' => 1,
|
||||
'dd' => 1,
|
||||
'dt' => 1,
|
||||
'rt' => 1,
|
||||
'rp' => 1,
|
||||
'tr' => 1,
|
||||
'th' => 1,
|
||||
'td' => 1,
|
||||
'thead' => 1,
|
||||
'tfoot' => 1,
|
||||
'tbody' => 1,
|
||||
'table' => 1,
|
||||
'optgroup' => 1,
|
||||
'option' => 1
|
||||
);
|
||||
|
||||
/**
|
||||
* Build a new rules engine.
|
||||
*
|
||||
* @param \DOMDocument $doc
|
||||
* The DOM document to use for evaluation and modification.
|
||||
*/
|
||||
public function __construct($doc)
|
||||
{
|
||||
$this->doc = $doc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given tagname has special processing rules.
|
||||
*/
|
||||
public function hasRules($tagname)
|
||||
{
|
||||
return isset(static::$tags[$tagname]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluate the rule for the current tag name.
|
||||
*
|
||||
* This may modify the existing DOM.
|
||||
*
|
||||
* @return \DOMElement The new Current DOM element.
|
||||
*/
|
||||
public function evaluate($new, $current)
|
||||
{
|
||||
switch ($new->tagName) {
|
||||
case 'li':
|
||||
return $this->handleLI($new, $current);
|
||||
case 'dt':
|
||||
case 'dd':
|
||||
return $this->handleDT($new, $current);
|
||||
case 'rt':
|
||||
case 'rp':
|
||||
return $this->handleRT($new, $current);
|
||||
case 'optgroup':
|
||||
return $this->closeIfCurrentMatches($new, $current, array(
|
||||
'optgroup'
|
||||
));
|
||||
case 'option':
|
||||
return $this->closeIfCurrentMatches($new, $current, array(
|
||||
'option',
|
||||
'optgroup'
|
||||
));
|
||||
case 'tr':
|
||||
return $this->closeIfCurrentMatches($new, $current, array(
|
||||
'tr'
|
||||
));
|
||||
case 'td':
|
||||
case 'th':
|
||||
return $this->closeIfCurrentMatches($new, $current, array(
|
||||
'th',
|
||||
'td'
|
||||
));
|
||||
case 'tbody':
|
||||
case 'thead':
|
||||
case 'tfoot':
|
||||
case 'table': // Spec isn't explicit about this, but it's necessary.
|
||||
|
||||
return $this->closeIfCurrentMatches($new, $current, array(
|
||||
'thead',
|
||||
'tfoot',
|
||||
'tbody'
|
||||
));
|
||||
}
|
||||
|
||||
return $current;
|
||||
}
|
||||
|
||||
protected function handleLI($ele, $current)
|
||||
{
|
||||
return $this->closeIfCurrentMatches($ele, $current, array(
|
||||
'li'
|
||||
));
|
||||
}
|
||||
|
||||
protected function handleDT($ele, $current)
|
||||
{
|
||||
return $this->closeIfCurrentMatches($ele, $current, array(
|
||||
'dt',
|
||||
'dd'
|
||||
));
|
||||
}
|
||||
|
||||
protected function handleRT($ele, $current)
|
||||
{
|
||||
return $this->closeIfCurrentMatches($ele, $current, array(
|
||||
'rt',
|
||||
'rp'
|
||||
));
|
||||
}
|
||||
|
||||
protected function closeIfCurrentMatches($ele, $current, $match)
|
||||
{
|
||||
$tname = $current->tagName;
|
||||
if (in_array($current->tagName, $match)) {
|
||||
$current->parentNode->appendChild($ele);
|
||||
} else {
|
||||
$current->appendChild($ele);
|
||||
}
|
||||
|
||||
return $ele;
|
||||
}
|
||||
}
|
||||
171
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/UTF8Utils.php
vendored
Normal file
171
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Parser/UTF8Utils.php
vendored
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
<?php
|
||||
namespace Masterminds\HTML5\Parser;
|
||||
/*
|
||||
*
|
||||
* Portions based on code from html5lib files with the following copyright:
|
||||
|
||||
Copyright 2009 Geoffrey Sneddon <http://gsnedders.com/>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS 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.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
/**
|
||||
* UTF-8 Utilities
|
||||
*/
|
||||
class UTF8Utils
|
||||
{
|
||||
|
||||
/**
|
||||
* The Unicode replacement character..
|
||||
*/
|
||||
const FFFD = "\xEF\xBF\xBD";
|
||||
|
||||
/**
|
||||
* Count the number of characters in a string.
|
||||
*
|
||||
* UTF-8 aware. This will try (in order) iconv,
|
||||
* MB, libxml, and finally a custom counter.
|
||||
*
|
||||
* @todo Move this to a general utility class.
|
||||
*/
|
||||
public static function countChars($string)
|
||||
{
|
||||
// Get the length for the string we need.
|
||||
if (function_exists('mb_strlen')) {
|
||||
return mb_strlen($string, 'utf-8');
|
||||
} elseif (function_exists('iconv_strlen')) {
|
||||
return iconv_strlen($string, 'utf-8');
|
||||
} elseif (function_exists('utf8_decode')) {
|
||||
// MPB: Will this work? Won't certain decodes lead to two chars
|
||||
// extrapolated out of 2-byte chars?
|
||||
return strlen(utf8_decode($string));
|
||||
}
|
||||
$count = count_chars($string);
|
||||
// 0x80 = 0x7F - 0 + 1 (one added to get inclusive range)
|
||||
// 0x33 = 0xF4 - 0x2C + 1 (one added to get inclusive range)
|
||||
return array_sum(array_slice($count, 0, 0x80)) + array_sum(array_slice($count, 0xC2, 0x33));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert data from the given encoding to UTF-8.
|
||||
*
|
||||
* This has not yet been tested with charactersets other than UTF-8.
|
||||
* It should work with ISO-8859-1/-13 and standard Latin Win charsets.
|
||||
*
|
||||
* @param string $data
|
||||
* The data to convert.
|
||||
* @param string $encoding
|
||||
* A valid encoding. Examples: http://www.php.net/manual/en/mbstring.supported-encodings.php
|
||||
*/
|
||||
public static function convertToUTF8($data, $encoding = 'UTF-8')
|
||||
{
|
||||
/*
|
||||
* From the HTML5 spec: Given an encoding, the bytes in the input stream must be converted to Unicode characters for the tokeniser, as described by the rules for that encoding, except that the leading U+FEFF BYTE ORDER MARK character, if any, must not be stripped by the encoding layer (it is stripped by the rule below). Bytes or sequences of bytes in the original byte stream that could not be converted to Unicode characters must be converted to U+FFFD REPLACEMENT CHARACTER code points.
|
||||
*/
|
||||
|
||||
// mb_convert_encoding is chosen over iconv because of a bug. The best
|
||||
// details for the bug are on http://us1.php.net/manual/en/function.iconv.php#108643
|
||||
// which contains links to the actual but reports as well as work around
|
||||
// details.
|
||||
if (function_exists('mb_convert_encoding')) {
|
||||
// mb library has the following behaviors:
|
||||
// - UTF-16 surrogates result in false.
|
||||
// - Overlongs and outside Plane 16 result in empty strings.
|
||||
|
||||
// Before we run mb_convert_encoding we need to tell it what to do with
|
||||
// characters it does not know. This could be different than the parent
|
||||
// application executing this library so we store the value, change it
|
||||
// to our needs, and then change it back when we are done. This feels
|
||||
// a little excessive and it would be great if there was a better way.
|
||||
$save = mb_substitute_character();
|
||||
mb_substitute_character('none');
|
||||
$data = mb_convert_encoding($data, 'UTF-8', $encoding);
|
||||
mb_substitute_character($save);
|
||||
} // @todo Get iconv running in at least some environments if that is possible.
|
||||
elseif (function_exists('iconv') && $encoding != 'auto') {
|
||||
// fprintf(STDOUT, "iconv found\n");
|
||||
// iconv has the following behaviors:
|
||||
// - Overlong representations are ignored.
|
||||
// - Beyond Plane 16 is replaced with a lower char.
|
||||
// - Incomplete sequences generate a warning.
|
||||
$data = @iconv($encoding, 'UTF-8//IGNORE', $data);
|
||||
} else {
|
||||
// we can make a conforming native implementation
|
||||
throw new Exception('Not implemented, please install mbstring or iconv');
|
||||
}
|
||||
|
||||
/*
|
||||
* One leading U+FEFF BYTE ORDER MARK character must be ignored if any are present.
|
||||
*/
|
||||
if (substr($data, 0, 3) === "\xEF\xBB\xBF") {
|
||||
$data = substr($data, 3);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for Unicode code points that are not valid in a document.
|
||||
*
|
||||
* @param string $data
|
||||
* A string to analyze.
|
||||
* @return array An array of (string) error messages produced by the scanning.
|
||||
*/
|
||||
public static function checkForIllegalCodepoints($data)
|
||||
{
|
||||
if (! function_exists('preg_match_all')) {
|
||||
throw\Exception('The PCRE library is not loaded or is not available.');
|
||||
}
|
||||
|
||||
// Vestigal error handling.
|
||||
$errors = array();
|
||||
|
||||
/*
|
||||
* All U+0000 null characters in the input must be replaced by U+FFFD REPLACEMENT CHARACTERs. Any occurrences of such characters is a parse error.
|
||||
*/
|
||||
for ($i = 0, $count = substr_count($data, "\0"); $i < $count; $i ++) {
|
||||
$errors[] = 'null-character';
|
||||
}
|
||||
|
||||
/*
|
||||
* Any occurrences of any characters in the ranges U+0001 to U+0008, U+000B, U+000E to U+001F, U+007F to U+009F, U+D800 to U+DFFF , U+FDD0 to U+FDEF, and characters U+FFFE, U+FFFF, U+1FFFE, U+1FFFF, U+2FFFE, U+2FFFF, U+3FFFE, U+3FFFF, U+4FFFE, U+4FFFF, U+5FFFE, U+5FFFF, U+6FFFE, U+6FFFF, U+7FFFE, U+7FFFF, U+8FFFE, U+8FFFF, U+9FFFE, U+9FFFF, U+AFFFE, U+AFFFF, U+BFFFE, U+BFFFF, U+CFFFE, U+CFFFF, U+DFFFE, U+DFFFF, U+EFFFE, U+EFFFF, U+FFFFE, U+FFFFF, U+10FFFE, and U+10FFFF are parse errors. (These are all control characters or permanently undefined Unicode characters.)
|
||||
*/
|
||||
// Check PCRE is loaded.
|
||||
$count = preg_match_all(
|
||||
'/(?:
|
||||
[\x01-\x08\x0B\x0E-\x1F\x7F] # U+0001 to U+0008, U+000B, U+000E to U+001F and U+007F
|
||||
|
|
||||
\xC2[\x80-\x9F] # U+0080 to U+009F
|
||||
|
|
||||
\xED(?:\xA0[\x80-\xFF]|[\xA1-\xBE][\x00-\xFF]|\xBF[\x00-\xBF]) # U+D800 to U+DFFFF
|
||||
|
|
||||
\xEF\xB7[\x90-\xAF] # U+FDD0 to U+FDEF
|
||||
|
|
||||
\xEF\xBF[\xBE\xBF] # U+FFFE and U+FFFF
|
||||
|
|
||||
[\xF0-\xF4][\x8F-\xBF]\xBF[\xBE\xBF] # U+nFFFE and U+nFFFF (1 <= n <= 10_{16})
|
||||
)/x', $data, $matches);
|
||||
for ($i = 0; $i < $count; $i ++) {
|
||||
$errors[] = 'invalid-codepoint';
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
}
|
||||
1533
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Serializer/HTML5Entities.php
vendored
Normal file
1533
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Serializer/HTML5Entities.php
vendored
Normal file
File diff suppressed because it is too large
Load diff
552
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Serializer/OutputRules.php
vendored
Normal file
552
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Serializer/OutputRules.php
vendored
Normal file
|
|
@ -0,0 +1,552 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* The rules for generating output in the serializer.
|
||||
*
|
||||
* These output rules are likely to generate output similar to the document that
|
||||
* was parsed. It is not intended to output exactly the document that was parsed.
|
||||
*/
|
||||
namespace Masterminds\HTML5\Serializer;
|
||||
|
||||
use Masterminds\HTML5\Elements;
|
||||
|
||||
/**
|
||||
* Generate the output html5 based on element rules.
|
||||
*/
|
||||
class OutputRules implements \Masterminds\HTML5\Serializer\RulesInterface
|
||||
{
|
||||
/**
|
||||
* Defined in http://www.w3.org/TR/html51/infrastructure.html#html-namespace-0
|
||||
*/
|
||||
const NAMESPACE_HTML = 'http://www.w3.org/1999/xhtml';
|
||||
|
||||
const NAMESPACE_MATHML = 'http://www.w3.org/1998/Math/MathML';
|
||||
|
||||
const NAMESPACE_SVG = 'http://www.w3.org/2000/svg';
|
||||
|
||||
const NAMESPACE_XLINK = 'http://www.w3.org/1999/xlink';
|
||||
|
||||
const NAMESPACE_XML = 'http://www.w3.org/XML/1998/namespace';
|
||||
|
||||
const NAMESPACE_XMLNS = 'http://www.w3.org/2000/xmlns/';
|
||||
|
||||
/**
|
||||
* Holds the HTML5 element names that causes a namespace switch
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $implicitNamespaces = array(
|
||||
self::NAMESPACE_HTML,
|
||||
self::NAMESPACE_SVG,
|
||||
self::NAMESPACE_MATHML,
|
||||
self::NAMESPACE_XML,
|
||||
self::NAMESPACE_XMLNS,
|
||||
);
|
||||
|
||||
const IM_IN_HTML = 1;
|
||||
|
||||
const IM_IN_SVG = 2;
|
||||
|
||||
const IM_IN_MATHML = 3;
|
||||
|
||||
/**
|
||||
* Used as cache to detect if is available ENT_HTML5
|
||||
* @var boolean
|
||||
*/
|
||||
private $hasHTML5 = false;
|
||||
|
||||
protected $traverser;
|
||||
|
||||
protected $encode = false;
|
||||
|
||||
protected $out;
|
||||
|
||||
protected $outputMode;
|
||||
|
||||
private $xpath;
|
||||
|
||||
protected $nonBooleanAttributes = array(
|
||||
/*
|
||||
array(
|
||||
'nodeNamespace'=>'http://www.w3.org/1999/xhtml',
|
||||
'attrNamespace'=>'http://www.w3.org/1999/xhtml',
|
||||
|
||||
'nodeName'=>'img', 'nodeName'=>array('img', 'a'),
|
||||
'attrName'=>'alt', 'attrName'=>array('title', 'alt'),
|
||||
),
|
||||
*/
|
||||
array(
|
||||
'nodeNamespace' => 'http://www.w3.org/1999/xhtml',
|
||||
'attrName' => array('href',
|
||||
'hreflang',
|
||||
'http-equiv',
|
||||
'icon',
|
||||
'id',
|
||||
'keytype',
|
||||
'kind',
|
||||
'label',
|
||||
'lang',
|
||||
'language',
|
||||
'list',
|
||||
'maxlength',
|
||||
'media',
|
||||
'method',
|
||||
'name',
|
||||
'placeholder',
|
||||
'rel',
|
||||
'rows',
|
||||
'rowspan',
|
||||
'sandbox',
|
||||
'spellcheck',
|
||||
'scope',
|
||||
'seamless',
|
||||
'shape',
|
||||
'size',
|
||||
'sizes',
|
||||
'span',
|
||||
'src',
|
||||
'srcdoc',
|
||||
'srclang',
|
||||
'srcset',
|
||||
'start',
|
||||
'step',
|
||||
'style',
|
||||
'summary',
|
||||
'tabindex',
|
||||
'target',
|
||||
'title',
|
||||
'type',
|
||||
'value',
|
||||
'width',
|
||||
'border',
|
||||
'charset',
|
||||
'cite',
|
||||
'class',
|
||||
'code',
|
||||
'codebase',
|
||||
'color',
|
||||
'cols',
|
||||
'colspan',
|
||||
'content',
|
||||
'coords',
|
||||
'data',
|
||||
'datetime',
|
||||
'default',
|
||||
'dir',
|
||||
'dirname',
|
||||
'enctype',
|
||||
'for',
|
||||
'form',
|
||||
'formaction',
|
||||
'headers',
|
||||
'height',
|
||||
'accept',
|
||||
'accept-charset',
|
||||
'accesskey',
|
||||
'action',
|
||||
'align',
|
||||
'alt',
|
||||
'bgcolor',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'nodeNamespace' => 'http://www.w3.org/1999/xhtml',
|
||||
'xpath' => 'starts-with(local-name(), \'data-\')',
|
||||
),
|
||||
);
|
||||
|
||||
const DOCTYPE = '<!DOCTYPE html>';
|
||||
|
||||
public function __construct($output, $options = array())
|
||||
{
|
||||
if (isset($options['encode_entities'])) {
|
||||
$this->encode = $options['encode_entities'];
|
||||
}
|
||||
|
||||
$this->outputMode = static::IM_IN_HTML;
|
||||
$this->out = $output;
|
||||
|
||||
// If HHVM, see https://github.com/facebook/hhvm/issues/2727
|
||||
$this->hasHTML5 = defined('ENT_HTML5') && !defined('HHVM_VERSION');
|
||||
}
|
||||
public function addRule(array $rule)
|
||||
{
|
||||
$this->nonBooleanAttributes[] = $rule;
|
||||
}
|
||||
|
||||
public function setTraverser(\Masterminds\HTML5\Serializer\Traverser $traverser)
|
||||
{
|
||||
$this->traverser = $traverser;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function document($dom)
|
||||
{
|
||||
$this->doctype();
|
||||
if ($dom->documentElement) {
|
||||
foreach ($dom->childNodes as $node) {
|
||||
$this->traverser->node($node);
|
||||
}
|
||||
$this->nl();
|
||||
}
|
||||
}
|
||||
|
||||
protected function doctype()
|
||||
{
|
||||
$this->wr(static::DOCTYPE);
|
||||
$this->nl();
|
||||
}
|
||||
|
||||
public function element($ele)
|
||||
{
|
||||
$name = $ele->tagName;
|
||||
|
||||
// Per spec:
|
||||
// If the element has a declared namespace in the HTML, MathML or
|
||||
// SVG namespaces, we use the lname instead of the tagName.
|
||||
if ($this->traverser->isLocalElement($ele)) {
|
||||
$name = $ele->localName;
|
||||
}
|
||||
|
||||
// If we are in SVG or MathML there is special handling.
|
||||
// Using if/elseif instead of switch because it's faster in PHP.
|
||||
if ($name == 'svg') {
|
||||
$this->outputMode = static::IM_IN_SVG;
|
||||
$name = Elements::normalizeSvgElement($name);
|
||||
} elseif ($name == 'math') {
|
||||
$this->outputMode = static::IM_IN_MATHML;
|
||||
}
|
||||
|
||||
$this->openTag($ele);
|
||||
if (Elements::isA($name, Elements::TEXT_RAW)) {
|
||||
foreach ($ele->childNodes as $child) {
|
||||
$this->wr($child->data);
|
||||
}
|
||||
} else {
|
||||
// Handle children.
|
||||
if ($ele->hasChildNodes()) {
|
||||
$this->traverser->children($ele->childNodes);
|
||||
}
|
||||
|
||||
// Close out the SVG or MathML special handling.
|
||||
if ($name == 'svg' || $name == 'math') {
|
||||
$this->outputMode = static::IM_IN_HTML;
|
||||
}
|
||||
}
|
||||
|
||||
// If not unary, add a closing tag.
|
||||
if (! Elements::isA($name, Elements::VOID_TAG)) {
|
||||
$this->closeTag($ele);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a text node.
|
||||
*
|
||||
* @param \DOMText $ele
|
||||
* The text node to write.
|
||||
*/
|
||||
public function text($ele)
|
||||
{
|
||||
if (isset($ele->parentNode) && isset($ele->parentNode->tagName) && Elements::isA($ele->parentNode->localName, Elements::TEXT_RAW)) {
|
||||
$this->wr($ele->data);
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME: This probably needs some flags set.
|
||||
$this->wr($this->enc($ele->data));
|
||||
}
|
||||
|
||||
public function cdata($ele)
|
||||
{
|
||||
// This encodes CDATA.
|
||||
$this->wr($ele->ownerDocument->saveXML($ele));
|
||||
}
|
||||
|
||||
public function comment($ele)
|
||||
{
|
||||
// These produce identical output.
|
||||
// $this->wr('<!--')->wr($ele->data)->wr('-->');
|
||||
$this->wr($ele->ownerDocument->saveXML($ele));
|
||||
}
|
||||
|
||||
public function processorInstruction($ele)
|
||||
{
|
||||
$this->wr('<?')
|
||||
->wr($ele->target)
|
||||
->wr(' ')
|
||||
->wr($ele->data)
|
||||
->wr('?>');
|
||||
}
|
||||
/**
|
||||
* Write the namespace attributes
|
||||
*
|
||||
*
|
||||
* @param \DOMNode $ele
|
||||
* The element being written.
|
||||
*/
|
||||
protected function namespaceAttrs($ele)
|
||||
{
|
||||
if (!$this->xpath || $this->xpath->document !== $ele->ownerDocument){
|
||||
$this->xpath = new \DOMXPath($ele->ownerDocument);
|
||||
}
|
||||
|
||||
foreach( $this->xpath->query('namespace::*[not(.=../../namespace::*)]', $ele ) as $nsNode ) {
|
||||
if (!in_array($nsNode->nodeValue, $this->implicitNamespaces)) {
|
||||
$this->wr(' ')->wr($nsNode->nodeName)->wr('="')->wr($nsNode->nodeValue)->wr('"');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Write the opening tag.
|
||||
*
|
||||
* Tags for HTML, MathML, and SVG are in the local name. Otherwise, use the
|
||||
* qualified name (8.3).
|
||||
*
|
||||
* @param \DOMNode $ele
|
||||
* The element being written.
|
||||
*/
|
||||
protected function openTag($ele)
|
||||
{
|
||||
$this->wr('<')->wr($this->traverser->isLocalElement($ele) ? $ele->localName : $ele->tagName);
|
||||
|
||||
|
||||
$this->attrs($ele);
|
||||
$this->namespaceAttrs($ele);
|
||||
|
||||
|
||||
if ($this->outputMode == static::IM_IN_HTML) {
|
||||
$this->wr('>');
|
||||
} // If we are not in html mode we are in SVG, MathML, or XML embedded content.
|
||||
else {
|
||||
if ($ele->hasChildNodes()) {
|
||||
$this->wr('>');
|
||||
} // If there are no children this is self closing.
|
||||
else {
|
||||
$this->wr(' />');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function attrs($ele)
|
||||
{
|
||||
// FIXME: Needs support for xml, xmlns, xlink, and namespaced elements.
|
||||
if (! $ele->hasAttributes()) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
// TODO: Currently, this always writes name="value", and does not do
|
||||
// value-less attributes.
|
||||
$map = $ele->attributes;
|
||||
$len = $map->length;
|
||||
for ($i = 0; $i < $len; ++ $i) {
|
||||
$node = $map->item($i);
|
||||
$val = $this->enc($node->value, true);
|
||||
|
||||
// XXX: The spec says that we need to ensure that anything in
|
||||
// the XML, XMLNS, or XLink NS's should use the canonical
|
||||
// prefix. It seems that DOM does this for us already, but there
|
||||
// may be exceptions.
|
||||
$name = $node->nodeName;
|
||||
|
||||
// Special handling for attributes in SVG and MathML.
|
||||
// Using if/elseif instead of switch because it's faster in PHP.
|
||||
if ($this->outputMode == static::IM_IN_SVG) {
|
||||
$name = Elements::normalizeSvgAttribute($name);
|
||||
} elseif ($this->outputMode == static::IM_IN_MATHML) {
|
||||
$name = Elements::normalizeMathMlAttribute($name);
|
||||
}
|
||||
|
||||
$this->wr(' ')->wr($name);
|
||||
|
||||
if ((isset($val) && $val !== '') || $this->nonBooleanAttribute($node)) {
|
||||
$this->wr('="')->wr($val)->wr('"');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function nonBooleanAttribute(\DOMAttr $attr)
|
||||
{
|
||||
$ele = $attr->ownerElement;
|
||||
foreach($this->nonBooleanAttributes as $rule){
|
||||
|
||||
if(isset($rule['nodeNamespace']) && $rule['nodeNamespace']!==$ele->namespaceURI){
|
||||
continue;
|
||||
}
|
||||
if(isset($rule['attNamespace']) && $rule['attNamespace']!==$attr->namespaceURI){
|
||||
continue;
|
||||
}
|
||||
if(isset($rule['nodeName']) && !is_array($rule['nodeName']) && $rule['nodeName']!==$ele->localName){
|
||||
continue;
|
||||
}
|
||||
if(isset($rule['nodeName']) && is_array($rule['nodeName']) && !in_array($ele->localName, $rule['nodeName'], true)){
|
||||
continue;
|
||||
}
|
||||
if(isset($rule['attrName']) && !is_array($rule['attrName']) && $rule['attrName']!==$attr->localName){
|
||||
continue;
|
||||
}
|
||||
if(isset($rule['attrName']) && is_array($rule['attrName']) && !in_array($attr->localName, $rule['attrName'], true)){
|
||||
continue;
|
||||
}
|
||||
if(isset($rule['xpath'])){
|
||||
|
||||
$xp = $this->getXPath($attr);
|
||||
if(isset($rule['prefixes'])){
|
||||
foreach($rule['prefixes'] as $nsPrefix => $ns){
|
||||
$xp->registerNamespace($nsPrefix, $ns);
|
||||
}
|
||||
}
|
||||
if(!$xp->evaluate($rule['xpath'], $attr)){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function getXPath(\DOMNode $node){
|
||||
if(!$this->xpath){
|
||||
$this->xpath = new \DOMXPath($node->ownerDocument);
|
||||
}
|
||||
return $this->xpath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write the closing tag.
|
||||
*
|
||||
* Tags for HTML, MathML, and SVG are in the local name. Otherwise, use the
|
||||
* qualified name (8.3).
|
||||
*
|
||||
* @param \DOMNode $ele
|
||||
* The element being written.
|
||||
*/
|
||||
protected function closeTag($ele)
|
||||
{
|
||||
if ($this->outputMode == static::IM_IN_HTML || $ele->hasChildNodes()) {
|
||||
$this->wr('</')->wr($this->traverser->isLocalElement($ele) ? $ele->localName : $ele->tagName)->wr('>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Write to the output.
|
||||
*
|
||||
* @param string $text
|
||||
* The string to put into the output.
|
||||
*
|
||||
* @return \Masterminds\HTML5\Serializer\Traverser $this so it can be used in chaining.
|
||||
*/
|
||||
protected function wr($text)
|
||||
{
|
||||
fwrite($this->out, $text);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a new line character.
|
||||
*
|
||||
* @return \Masterminds\HTML5\Serializer\Traverser $this so it can be used in chaining.
|
||||
*/
|
||||
protected function nl()
|
||||
{
|
||||
fwrite($this->out, PHP_EOL);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode text.
|
||||
*
|
||||
* When encode is set to false, the default value, the text passed in is
|
||||
* escaped per section 8.3 of the html5 spec. For details on how text is
|
||||
* escaped see the escape() method.
|
||||
*
|
||||
* When encoding is set to true the text is converted to named character
|
||||
* references where appropriate. Section 8.1.4 Character references of the
|
||||
* html5 spec refers to using named character references. This is useful for
|
||||
* characters that can't otherwise legally be used in the text.
|
||||
*
|
||||
* The named character references are listed in section 8.5.
|
||||
*
|
||||
* @see http://www.w3.org/TR/2013/CR-html5-20130806/syntax.html#named-character-references True encoding will turn all named character references into their entities.
|
||||
* This includes such characters as +.# and many other common ones. By default
|
||||
* encoding here will just escape &'<>".
|
||||
*
|
||||
* Note, PHP 5.4+ has better html5 encoding.
|
||||
*
|
||||
* @todo Use the Entities class in php 5.3 to have html5 entities.
|
||||
*
|
||||
* @param string $text
|
||||
* text to encode.
|
||||
* @param boolean $attribute
|
||||
* True if we are encoding an attrubute, false otherwise
|
||||
*
|
||||
* @return string The encoded text.
|
||||
*/
|
||||
protected function enc($text, $attribute = false)
|
||||
{
|
||||
|
||||
// Escape the text rather than convert to named character references.
|
||||
if (! $this->encode) {
|
||||
return $this->escape($text, $attribute);
|
||||
}
|
||||
|
||||
// If we are in PHP 5.4+ we can use the native html5 entity functionality to
|
||||
// convert the named character references.
|
||||
|
||||
if ($this->hasHTML5) {
|
||||
return htmlentities($text, ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES, 'UTF-8', false);
|
||||
} // If a version earlier than 5.4 html5 entities are not entirely handled.
|
||||
// This manually handles them.
|
||||
else {
|
||||
return strtr($text, \Masterminds\HTML5\Serializer\HTML5Entities::$map);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape test.
|
||||
*
|
||||
* According to the html5 spec section 8.3 Serializing HTML fragments, text
|
||||
* within tags that are not style, script, xmp, iframe, noembed, and noframes
|
||||
* need to be properly escaped.
|
||||
*
|
||||
* The & should be converted to &, no breaking space unicode characters
|
||||
* converted to , when in attribute mode the " should be converted to
|
||||
* ", and when not in attribute mode the < and > should be converted to
|
||||
* < and >.
|
||||
*
|
||||
* @see http://www.w3.org/TR/2013/CR-html5-20130806/syntax.html#escapingString
|
||||
*
|
||||
* @param string $text
|
||||
* text to escape.
|
||||
* @param boolean $attribute
|
||||
* True if we are escaping an attrubute, false otherwise
|
||||
*/
|
||||
protected function escape($text, $attribute = false)
|
||||
{
|
||||
|
||||
// Not using htmlspecialchars because, while it does escaping, it doesn't
|
||||
// match the requirements of section 8.5. For example, it doesn't handle
|
||||
// non-breaking spaces.
|
||||
if ($attribute) {
|
||||
$replace = array(
|
||||
'"' => '"',
|
||||
'&' => '&',
|
||||
"\xc2\xa0" => ' '
|
||||
);
|
||||
} else {
|
||||
$replace = array(
|
||||
'<' => '<',
|
||||
'>' => '>',
|
||||
'&' => '&',
|
||||
"\xc2\xa0" => ' '
|
||||
);
|
||||
}
|
||||
|
||||
return strtr($text, $replace);
|
||||
}
|
||||
}
|
||||
33
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Serializer/README.md
vendored
Normal file
33
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Serializer/README.md
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# The Serializer (Writer) Model
|
||||
|
||||
The serializer roughly follows sections _8.1 Writing HTML documents_ and section
|
||||
_8.3 Serializing HTML fragments_ by converting DOMDocument, DOMDocumentFragment,
|
||||
and DOMNodeList into HTML5.
|
||||
|
||||
[ HTML5 ] // Interface for saving.
|
||||
||
|
||||
[ Traverser ] // Walk the DOM
|
||||
||
|
||||
[ Rules ] // Convert DOM elements into strings.
|
||||
||
|
||||
[ HTML5 ] // HTML5 document or fragment in text.
|
||||
|
||||
|
||||
## HTML5 Class
|
||||
|
||||
Provides the top level interface for saving.
|
||||
|
||||
## The Traverser
|
||||
|
||||
Walks the DOM finding each element and passing it off to the output rules to
|
||||
convert to HTML5.
|
||||
|
||||
## Output Rules
|
||||
|
||||
The output rules are defined in the RulesInterface which can have multiple
|
||||
implementations. Currently, the OutputRules is the default implementation that
|
||||
converts a DOM as is into HTML5.
|
||||
|
||||
## HTML5 String
|
||||
|
||||
The output of the process it HTML5 as a string or saved to a file.
|
||||
103
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Serializer/RulesInterface.php
vendored
Normal file
103
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Serializer/RulesInterface.php
vendored
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* The interface definition for Rules to generate output.
|
||||
*/
|
||||
namespace Masterminds\HTML5\Serializer;
|
||||
|
||||
/**
|
||||
* To create a new rule set for writing output the RulesInterface needs to be
|
||||
* implemented.
|
||||
* The resulting class can be specified in the options with the
|
||||
* key of rules.
|
||||
*
|
||||
* For an example implementation see \Masterminds\HTML5\Serializer\OutputRules.
|
||||
*/
|
||||
interface RulesInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* The class constructor.
|
||||
*
|
||||
* Note, before the rules can be used a traverser must be registered.
|
||||
*
|
||||
* @param mixed $output
|
||||
* The output stream to write output to.
|
||||
* @param array $options
|
||||
* An array of options.
|
||||
*/
|
||||
public function __construct($output, $options = array());
|
||||
|
||||
/**
|
||||
* Register the traverser used in but the rules.
|
||||
*
|
||||
* Note, only one traverser can be used by the rules.
|
||||
*
|
||||
* @param \Masterminds\HTML5\Serializer\Traverser $traverser
|
||||
* The traverser used in the rules.
|
||||
* @return \Masterminds\HTML5\Serializer\RulesInterface $this for the current object.
|
||||
*/
|
||||
public function setTraverser(\Masterminds\HTML5\Serializer\Traverser $traverser);
|
||||
|
||||
/**
|
||||
* Write a document element (\DOMDocument).
|
||||
*
|
||||
* Instead of returning the result write it to the output stream ($output)
|
||||
* that was passed into the constructor.
|
||||
*
|
||||
* @param \DOMDocument $dom
|
||||
*/
|
||||
public function document($dom);
|
||||
|
||||
/**
|
||||
* Write an element.
|
||||
*
|
||||
* Instead of returning the result write it to the output stream ($output)
|
||||
* that was passed into the constructor.
|
||||
*
|
||||
* @param mixed $ele
|
||||
*/
|
||||
public function element($ele);
|
||||
|
||||
/**
|
||||
* Write a text node.
|
||||
*
|
||||
* Instead of returning the result write it to the output stream ($output)
|
||||
* that was passed into the constructor.
|
||||
*
|
||||
* @param mixed $ele
|
||||
*/
|
||||
public function text($ele);
|
||||
|
||||
/**
|
||||
* Write a CDATA node.
|
||||
*
|
||||
* Instead of returning the result write it to the output stream ($output)
|
||||
* that was passed into the constructor.
|
||||
*
|
||||
* @param mixed $ele
|
||||
*/
|
||||
public function cdata($ele);
|
||||
|
||||
/**
|
||||
* Write a comment node.
|
||||
*
|
||||
* Instead of returning the result write it to the output stream ($output)
|
||||
* that was passed into the constructor.
|
||||
*
|
||||
* @param mixed $ele
|
||||
*/
|
||||
public function comment($ele);
|
||||
|
||||
/**
|
||||
* Write a processor instruction.
|
||||
*
|
||||
* To learn about processor instructions see \Masterminds\HTML5\InstructionProcessor
|
||||
*
|
||||
* Instead of returning the result write it to the output stream ($output)
|
||||
* that was passed into the constructor.
|
||||
*
|
||||
* @param mixed $ele
|
||||
*/
|
||||
public function processorInstruction($ele);
|
||||
}
|
||||
149
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Serializer/Traverser.php
vendored
Normal file
149
site/OFF_plugins/typography/vendor/Masterminds/HTML5/Serializer/Traverser.php
vendored
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
<?php
|
||||
namespace Masterminds\HTML5\Serializer;
|
||||
|
||||
/**
|
||||
* Traverser for walking a DOM tree.
|
||||
*
|
||||
* This is a concrete traverser designed to convert a DOM tree into an
|
||||
* HTML5 document. It is not intended to be a generic DOMTreeWalker
|
||||
* implementation.
|
||||
*
|
||||
* @see http://www.w3.org/TR/2012/CR-html5-20121217/syntax.html#serializing-html-fragments
|
||||
*/
|
||||
class Traverser
|
||||
{
|
||||
|
||||
/**
|
||||
* Namespaces that should be treated as "local" to HTML5.
|
||||
*/
|
||||
static $local_ns = array(
|
||||
'http://www.w3.org/1999/xhtml' => 'html',
|
||||
'http://www.w3.org/1998/Math/MathML' => 'math',
|
||||
'http://www.w3.org/2000/svg' => 'svg'
|
||||
);
|
||||
|
||||
protected $dom;
|
||||
|
||||
protected $options;
|
||||
|
||||
protected $encode = false;
|
||||
|
||||
protected $rules;
|
||||
|
||||
protected $out;
|
||||
|
||||
/**
|
||||
* Create a traverser.
|
||||
*
|
||||
* @param DOMNode|DOMNodeList $dom
|
||||
* The document or node to traverse.
|
||||
* @param resource $out
|
||||
* A stream that allows writing. The traverser will output into this
|
||||
* stream.
|
||||
* @param array $options
|
||||
* An array or options for the traverser as key/value pairs. These include:
|
||||
* - encode_entities: A bool to specify if full encding should happen for all named
|
||||
* charachter references. Defaults to false which escapes &'<>".
|
||||
* - output_rules: The path to the class handling the output rules.
|
||||
*/
|
||||
public function __construct($dom, $out, RulesInterface $rules, $options = array())
|
||||
{
|
||||
$this->dom = $dom;
|
||||
$this->out = $out;
|
||||
$this->rules = $rules;
|
||||
$this->options = $options;
|
||||
|
||||
$this->rules->setTraverser($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tell the traverser to walk the DOM.
|
||||
*
|
||||
* @return resource $out
|
||||
* Returns the output stream.
|
||||
*/
|
||||
public function walk()
|
||||
{
|
||||
if ($this->dom instanceof \DOMDocument) {
|
||||
$this->rules->document($this->dom);
|
||||
} elseif ($this->dom instanceof \DOMDocumentFragment) {
|
||||
// Document fragments are a special case. Only the children need to
|
||||
// be serialized.
|
||||
if ($this->dom->hasChildNodes()) {
|
||||
$this->children($this->dom->childNodes);
|
||||
}
|
||||
} // If NodeList, loop
|
||||
elseif ($this->dom instanceof \DOMNodeList) {
|
||||
// If this is a NodeList of DOMDocuments this will not work.
|
||||
$this->children($this->dom);
|
||||
} // Else assume this is a DOMNode-like datastructure.
|
||||
else {
|
||||
$this->node($this->dom);
|
||||
}
|
||||
|
||||
return $this->out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process a node in the DOM.
|
||||
*
|
||||
* @param mixed $node
|
||||
* A node implementing \DOMNode.
|
||||
*/
|
||||
public function node($node)
|
||||
{
|
||||
// A listing of types is at http://php.net/manual/en/dom.constants.php
|
||||
switch ($node->nodeType) {
|
||||
case XML_ELEMENT_NODE:
|
||||
$this->rules->element($node);
|
||||
break;
|
||||
case XML_TEXT_NODE:
|
||||
$this->rules->text($node);
|
||||
break;
|
||||
case XML_CDATA_SECTION_NODE:
|
||||
$this->rules->cdata($node);
|
||||
break;
|
||||
case XML_PI_NODE:
|
||||
$this->rules->processorInstruction($node);
|
||||
break;
|
||||
case XML_COMMENT_NODE:
|
||||
$this->rules->comment($node);
|
||||
break;
|
||||
// Currently we don't support embedding DTDs.
|
||||
default:
|
||||
//print '<!-- Skipped -->';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Walk through all the nodes on a node list.
|
||||
*
|
||||
* @param \DOMNodeList $nl
|
||||
* A list of child elements to walk through.
|
||||
*/
|
||||
public function children($nl)
|
||||
{
|
||||
foreach ($nl as $node) {
|
||||
$this->node($node);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Is an element local?
|
||||
*
|
||||
* @param mixed $ele
|
||||
* An element that implement \DOMNode.
|
||||
*
|
||||
* @return bool True if local and false otherwise.
|
||||
*/
|
||||
public function isLocalElement($ele)
|
||||
{
|
||||
$uri = $ele->namespaceURI;
|
||||
if (empty($uri)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return isset(static::$local_ns[$uri]);
|
||||
}
|
||||
}
|
||||
46
site/OFF_plugins/typography/vendor/Masterminds/HTML5/autoload.php
vendored
Normal file
46
site/OFF_plugins/typography/vendor/Masterminds/HTML5/autoload.php
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
/**
|
||||
* This file contains an autoload function.
|
||||
*
|
||||
* PHP Version 5.3
|
||||
*
|
||||
* @category XML
|
||||
* @package XmlQuery
|
||||
* @author Gonzalo Chumillas <gonzalo@soloproyectos.com>
|
||||
* @license https://raw.github.com/soloproyectos/core/master/LICENSE BSD 2-Clause License
|
||||
* @link https://github.com/soloproyectos/core
|
||||
*/
|
||||
|
||||
spl_autoload_register(
|
||||
function ($classname) {
|
||||
|
||||
if (strpos($classname, "Mastermind") === false)
|
||||
return;
|
||||
|
||||
$classname = preg_replace('/^' . preg_quote("Masterminds\\HTML5\\", '/') . '/', '', $classname);
|
||||
|
||||
if (preg_match_all("/[A-Z][a-z,0-9]*/", $classname, $matches)) {
|
||||
// script filename
|
||||
$dir = __DIR__;
|
||||
$name = "";
|
||||
$items = $matches[0];
|
||||
|
||||
foreach ($items as $item) {
|
||||
$d = $dir . '/' . $item;
|
||||
if (is_dir($d)) {
|
||||
$dir = $d;
|
||||
$item = "";
|
||||
}
|
||||
|
||||
$name = $name . $item;
|
||||
}
|
||||
$filename = $dir . '/' . $name . ".php";
|
||||
|
||||
if (!is_file($filename)) {
|
||||
throw new Exception("Script not found: $filename");
|
||||
}
|
||||
|
||||
include_once $filename;
|
||||
}
|
||||
}
|
||||
);
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue