Comments (5)
I think Gematria should definitely be part of a package like this, and that the Hebrew
class is the ideal place for it.
I have been working on a class to represent Hebrew characters. Besides for other functionality associated with particular characters, an instance of HebrewChar
can contain values used for the various types of Gematria that is supported in Hebrew
. Within Hebrew
we can have a way of getting the string as an array of HebrewChar
's which will allow us to perform the mathematical operations!
A very early version of this can be seen in the HebrewGlyph branch of this repo. I have already put more work into it and intend to continue work and push major updates tonight.
Contributions to the Gematria feature would be extremely welcome! I'll focus my efforts on getting things in place in the HebrewChar
class so that you can begin to contribute if you choose to.
from hebrew.
@yoavcaspi I've completed the work mentioned above and added the first gematria type, the most used, MISPAR_HECHRACHI
. What follows is an overview of my implementation so that you may work on additional methods, but feel free to suggest changes to the way it has been implemented.
I'm going to leave this issue open for a while so there is a place for discussion if necessary.
Hebrew.gematria()
To get the gematria value for a Hebrew string, we use the Hebrew.gematria
. The gematria
function accepts a method
parameter which defaults to MISPAR_HECHRACHI
. Additional methods available are listed in the hebrew.gematria.GematriaTypes
Enum.
Character Values
In order to calculate the gematria of a word or sentence, we need to know the value of each letter for that specific method of gematria. In hebrew.chars
each letter used in Hebrew text is defined as a constant, this is a good place to codify the value of each letter. Rather than putting the value directly on each constant, a @property
is used to look up the value in hebrew.gematria
.
Because of how Hebrew.gematria
was written and the way the values were defined in hebrew.gematria
, it is necessary for the HebrewChar
property name and the GematriaTypes
value to match. I'm not particularly fond of this.
Testing
All tests related to gematria are within test_gematria.py
. This includes tests related to gematria from any class to keep all tests related to this topic in one place.
Other
- If the gematria method does not have separately defined values for final letters (sofit) the value should be explicitly defined as being the same as its nonfinal form.
Resources
I found this site to be a great resource for a list of gematria methods, how they are calculated, the values for each letter, and a calculator we can use as a source of truth for tests. Let's take all spelling from there.
from hebrew.
I don't see the branch you are referring to in the repository.
Are you sure this branch is in the remote and not just locally?
from hebrew.
The branch I referenced was removed after merging the code.
from hebrew.
Closing this issue, Gimatria methods are slowly being added.
from hebrew.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hebrew.