-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5492771
commit fd74c11
Showing
1,773 changed files
with
94,651 additions
and
6,351 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
include ptext/pdf/canvas/font/afm/*.afm | ||
include ptext/io/write/ascii_art/ascii_logo.txt | ||
include borb/io/write/ascii_art/ascii_logo.txt | ||
include borb/pdf/canvas/font/composite_font/cmaps/* | ||
include borb/pdf/canvas/font/simple_font/afm/*.afm | ||
include borb/pdf/canvas/layout/emoji/resources/*.png | ||
include borb/pdf/canvas/layout/hyphenation/resources/*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
""" | ||
This file is part of the ptext (R) project. | ||
Copyright (c) 2020-2040 ptext Group NV | ||
This file is part of the borb (R) project. | ||
Copyright (c) 2020-2040 borb Group NV | ||
Authors: Joris Schellekens, et al. | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License version 3 | ||
as published by the Free Software Foundation with the addition of the | ||
following permission added to Section 15 as permitted in Section 7(a): | ||
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY | ||
PTEXT GROUP. PTEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT | ||
BORB GROUP. BORB GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT | ||
OF THIRD PARTY RIGHTS | ||
This program is distributed in the hope that it will be useful, but | ||
|
@@ -27,17 +27,17 @@ | |
Section 5 of the GNU Affero General Public License. | ||
In accordance with Section 7(b) of the GNU Affero General Public License, | ||
a covered work must retain the producer line in every PDF that is created | ||
or manipulated using ptext. | ||
or manipulated using borb. | ||
You can be released from the requirements of the license by purchasing | ||
a commercial license. Buying such a license is mandatory as soon as you | ||
develop commercial activities involving the ptext software without | ||
develop commercial activities involving the borb software without | ||
disclosing the source code of your own applications. | ||
These activities include: offering paid services to customers as an ASP, | ||
serving PDFs on the fly in a web application, shipping ptext with a closed | ||
serving PDFs on the fly in a web application, shipping borb with a closed | ||
source product. | ||
For more information, please contact ptext Software Corp. at this | ||
For more information, please contact borb Software Corp. at this | ||
address: [email protected] | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
""" | ||
This file is part of the ptext (R) project. | ||
Copyright (c) 2020-2040 ptext Group NV | ||
This file is part of the borb (R) project. | ||
Copyright (c) 2020-2040 borb Group NV | ||
Authors: Joris Schellekens, et al. | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License version 3 | ||
as published by the Free Software Foundation with the addition of the | ||
following permission added to Section 15 as permitted in Section 7(a): | ||
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY | ||
PTEXT GROUP. PTEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT | ||
BORB GROUP. BORB GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT | ||
OF THIRD PARTY RIGHTS | ||
This program is distributed in the hope that it will be useful, but | ||
|
@@ -27,17 +27,17 @@ | |
Section 5 of the GNU Affero General Public License. | ||
In accordance with Section 7(b) of the GNU Affero General Public License, | ||
a covered work must retain the producer line in every PDF that is created | ||
or manipulated using ptext. | ||
or manipulated using borb. | ||
You can be released from the requirements of the license by purchasing | ||
a commercial license. Buying such a license is mandatory as soon as you | ||
develop commercial activities involving the ptext software without | ||
develop commercial activities involving the borb software without | ||
disclosing the source code of your own applications. | ||
These activities include: offering paid services to customers as an ASP, | ||
serving PDFs on the fly in a web application, shipping ptext with a closed | ||
serving PDFs on the fly in a web application, shipping borb with a closed | ||
source product. | ||
For more information, please contact ptext Software Corp. at this | ||
For more information, please contact borb Software Corp. at this | ||
address: [email protected] | ||
""" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
This class represents a trie[str, typing.Any] | ||
""" | ||
import typing | ||
|
||
|
||
class Trie: | ||
""" | ||
This class represents a trie[str, typing.Any] | ||
""" | ||
|
||
class TrieNode: | ||
""" | ||
This class represents a node in a trie | ||
""" | ||
|
||
def __init__(self, value: typing.Optional[typing.Any] = None): | ||
self._children: typing.Dict[str, "TrieNode"] = {} | ||
self._value: typing.Optional[typing.Any] = value | ||
|
||
def __len__(self) -> int: | ||
return (0 if self._value is None else 1) + sum( | ||
[len(v) for k, v in self._children.items()] | ||
) | ||
|
||
def __init__(self): | ||
self._root: typing.Optional[Trie.TrieNode] = None | ||
|
||
def __len__(self) -> int: | ||
return 0 if self._root is None else len(self._root) | ||
|
||
def __getitem__(self, item) -> typing.Optional[typing.Any]: | ||
n: typing.Optional[Trie.TrieNode] = self._root | ||
if n is None: | ||
return None | ||
for c in item: | ||
if c in n._children: | ||
n = n._children[c] | ||
else: | ||
return None | ||
assert n is not None | ||
return n._value | ||
|
||
def __setitem__(self, key, value): | ||
n: typing.Optional[Trie.TrieNode] = self._root | ||
if n is None: | ||
self._root = Trie.TrieNode() | ||
n = self._root | ||
assert n is not None | ||
for c in key: | ||
if c not in n._children: | ||
n._children[c] = Trie.TrieNode() | ||
n = n._children[c] | ||
assert n is not None | ||
n._value = value | ||
return self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
""" | ||
This file is part of the ptext (R) project. | ||
Copyright (c) 2020-2040 ptext Group NV | ||
This file is part of the borb (R) project. | ||
Copyright (c) 2020-2040 borb Group NV | ||
Authors: Joris Schellekens, et al. | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License version 3 | ||
as published by the Free Software Foundation with the addition of the | ||
following permission added to Section 15 as permitted in Section 7(a): | ||
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY | ||
PTEXT GROUP. PTEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT | ||
BORB GROUP. BORB GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT | ||
OF THIRD PARTY RIGHTS | ||
This program is distributed in the hope that it will be useful, but | ||
|
@@ -27,17 +27,17 @@ | |
Section 5 of the GNU Affero General Public License. | ||
In accordance with Section 7(b) of the GNU Affero General Public License, | ||
a covered work must retain the producer line in every PDF that is created | ||
or manipulated using ptext. | ||
or manipulated using borb. | ||
You can be released from the requirements of the license by purchasing | ||
a commercial license. Buying such a license is mandatory as soon as you | ||
develop commercial activities involving the ptext software without | ||
develop commercial activities involving the borb software without | ||
disclosing the source code of your own applications. | ||
These activities include: offering paid services to customers as an ASP, | ||
serving PDFs on the fly in a web application, shipping ptext with a closed | ||
serving PDFs on the fly in a web application, shipping borb with a closed | ||
source product. | ||
For more information, please contact ptext Software Corp. at this | ||
For more information, please contact borb Software Corp. at this | ||
address: [email protected] | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
""" | ||
This file is part of the ptext (R) project. | ||
Copyright (c) 2020-2040 ptext Group NV | ||
This file is part of the borb (R) project. | ||
Copyright (c) 2020-2040 borb Group NV | ||
Authors: Joris Schellekens, et al. | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License version 3 | ||
as published by the Free Software Foundation with the addition of the | ||
following permission added to Section 15 as permitted in Section 7(a): | ||
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY | ||
PTEXT GROUP. PTEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT | ||
BORB GROUP. BORB GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT | ||
OF THIRD PARTY RIGHTS | ||
This program is distributed in the hope that it will be useful, but | ||
|
@@ -27,17 +27,17 @@ | |
Section 5 of the GNU Affero General Public License. | ||
In accordance with Section 7(b) of the GNU Affero General Public License, | ||
a covered work must retain the producer line in every PDF that is created | ||
or manipulated using ptext. | ||
or manipulated using borb. | ||
You can be released from the requirements of the license by purchasing | ||
a commercial license. Buying such a license is mandatory as soon as you | ||
develop commercial activities involving the ptext software without | ||
develop commercial activities involving the borb software without | ||
disclosing the source code of your own applications. | ||
These activities include: offering paid services to customers as an ASP, | ||
serving PDFs on the fly in a web application, shipping ptext with a closed | ||
serving PDFs on the fly in a web application, shipping borb with a closed | ||
source product. | ||
For more information, please contact ptext Software Corp. at this | ||
For more information, please contact borb Software Corp. at this | ||
address: [email protected] | ||
""" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
""" | ||
This file is part of the borb (R) project. | ||
Copyright (c) 2020-2040 borb Group NV | ||
Authors: Joris Schellekens, et al. | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License version 3 | ||
as published by the Free Software Foundation with the addition of the | ||
following permission added to Section 15 as permitted in Section 7(a): | ||
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY | ||
BORB GROUP. BORB GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT | ||
OF THIRD PARTY RIGHTS | ||
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 Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program; if not, see http://www.gnu.org/licenses or write to | ||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
Boston, MA, 02110-1301 USA. | ||
The interactive user interfaces in modified source and object code versions | ||
of this program must display Appropriate Legal Notices, as required under | ||
Section 5 of the GNU Affero General Public License. | ||
In accordance with Section 7(b) of the GNU Affero General Public License, | ||
a covered work must retain the producer line in every PDF that is created | ||
or manipulated using borb. | ||
You can be released from the requirements of the license by purchasing | ||
a commercial license. Buying such a license is mandatory as soon as you | ||
develop commercial activities involving the borb software without | ||
disclosing the source code of your own applications. | ||
These activities include: offering paid services to customers as an ASP, | ||
serving PDFs on the fly in a web application, shipping borb with a closed | ||
source product. | ||
For more information, please contact borb Software Corp. at this | ||
address: [email protected] | ||
""" |
Oops, something went wrong.