GithubHelp home page GithubHelp logo

perseids-project / lsj-js Goto Github PK

View Code? Open in Web Editor NEW
14.0 4.0 1.0 93.17 MB

Liddell-Scott-Jones Greek-English Lexicon in JavaScript

Home Page: https://apps.perseids.org/lsj/

License: MIT License

HTML 14.16% JavaScript 83.39% CSS 2.45%
perseids-project ancient-greek dictionary classics

lsj-js's Introduction

LSJ JS

This is the entire Liddell-Scott-Jones Greek-English Lexicon in JavaScript. You should be able to use this web app with or without internet access after you load it once.

Source

The LSJ text used is based on https://archive.org/details/Lsj--LiddellScott.

Try it Out

https://apps.perseids.org/lsj/

How to Use

Type a word in the input box and you should see the definition(s) appear below.

Iota after a long vowel can be written either as subscript or not: ᾗπερ and ἧιπερ are both valid.

If you include accents, breathing, and the iota subscript, then they will be included in the search. If you leave them out, it will try to find all potential matches.

You can also use Latin characters. The romanization is pretty flexible. For example, heiper, heper, eiper, and eper all work for ᾗπερ.

Installation

yarn install

Updating the dictionary

Update the file vendor/lsj.json with any changes then run yarn run build-dictionary.

Running the development server

yarn start

Building for deployment

Before creating a production build you need to know the path where it will be accessed. Then run the command PUBLIC_URL='./path/of/app' yarn build. This will generate a set of static files in the build/ directory that you can serve.

For example, if you want to deploy it at www.example.com/ then run PUBLIC_URL='./' yarn build. If you want to deploy it at www.example.com/lexica/lsj then run PUBLIC_URL='./lexica/lsj' yarn build.

Running tests

yarn test

Linting the code

yarn lint

Deploying a new version to github.io

yarn deploy-github

Deploying a new version to Perseids

yarn deploy-perseids

lsj-js's People

Contributors

aonkondey01 avatar benjaminsau avatar zfletch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

nikolas-n

lsj-js's Issues

Yarn lint warnings

When running yarn lint we get the warning below. It's not causing any problems currently, but we should fix it if possible. We may need to wait for an update of one or more package.

(node:71438) [ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in "node_modules/eslint-config-airbnb-base/index.js")

Meet the "Add to Home Screen" criteria

Google has recommendations for an app to be considered PWA that can be added to a user's home screen (https://developers.google.com/web/fundamentals/app-install-banners/). Auditing the app with lighthouse, it looks like the only thing we're missing are icons of at least 192px and 512px.

I was thinking the logo could be something like the text "LSJ" maybe "Liddell-Scott-Jones Greek-English Lexicon" with the Perseids flower logo in the corner. Plain text might also work.

Some Latin words have υ (upsilon) in them

There are some words in vendor/lsj.json where the latinization (the "l" key in the JSON) has a υ (the Greek upsilon) character mixed in with the Latin characters. We need a script that will go through the JSON and fix it. For an example, see entry ἀκίνδῡν-ος.

Fixing it is a little more complicated than replacing all υ characters with u. The dictionary allows users to type either u or y to represent the character υ. That means that the script will need to transform this

"l": [
  "kindυnos"
]

into this

"l": [
  "kindunos",
  "kindynos"
]

The script will also need to account for words with multiple υs.


Here's a Ruby script that replaces all υs with us. It might be a good starting point.

require 'json'

json = JSON.parse(File.read("vendor/lsj.json"))

json.each do |headword, definition|
  definition["l"] = definition["l"].map { |latin| latin.gsub("υ", "u") }
end

File.write("vendor/lsj.json", JSON.pretty_generate(json) + "\n")

Words that start with two vowels and rough breathing not correctly Latinized

When a word starts with two vowels with a rough breathing, it's being Latinized with the "h" in the middle of the two vowels. For example, εἷς becomes ehis).

We should write a script that goes through vendor/lsj.json, finds all of the words that are incorrect, and changes them.

Unfortunately, we can't just look for words where the Latin version is vowel-h-vowel because there are some weird words where that's the way they should be, like κρᾱἅρα. I think we need to look to see if the exact match (m in the JSON) starts with a diphthong with a rough breathing and change the Latin based on that.

screen shot 2018-07-26 at 12 16 47

Full-text search

Once we finish #4 then we can add a full-text search. This should probably be on a separate page, having a simple headword lookup is a good feature for a dictionary.

Reorganize application into component directories

Instead of src/Whatever.js we should have src/Whatever/Whatever.js and src/Whatever/index.js. The content of Whatever.js should be the same. index.js should have the following content:

import Whatever from './Whatever';

export default Whatever;

Markup tag left in description

In some entries there is an '&amp' markup tag left in the description. E.g. at ἀκμάζω:

ἔχεσθαι **'**tis time to . ., A.Th.97 (lyr.)

This should be rendered as a single apostrophe. I.e. " 'tis time to. . "

Yarn warnings

yarn install generates the following warnings. None of the warnings prevent the application from running, but we should try to get rid of them anyway.

warning " > [email protected]" has unmet peer dependency "[email protected] - 3".
warning " > [email protected]" has unmet peer dependency "popper.js@^1.14.3".
warning " > [email protected]" has incorrect peer dependency "eslint@^4.19.1".
warning "eslint-config-airbnb > [email protected]" has incorrect peer dependency "eslint@^4.19.1".
warning " > [email protected]" has incorrect peer dependency "eslint@^4.1.1".
warning " > [email protected]" has incorrect peer dependency "eslint-plugin-jsx-a11y@^5.1.1".
warning " > [email protected]" has incorrect peer dependency "eslint@>=1.6.0 <5.0.0".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.