ninjaman494 / hanji-server Goto Github PK
View Code? Open in Web Editor NEWJavaScript server for conjugating Korean words. Uses the algorithm built by Dan Bravender
License: Apache License 2.0
JavaScript server for conjugating Korean words. Uses the algorithm built by Dan Bravender
License: Apache License 2.0
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.
@graphql-codegen/cli
, @graphql-codegen/typescript
, @graphql-codegen/typescript-resolvers
, @types/graphql-upload
, graphql-rate-limit-directive
, graphql-upload
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
dotenv
, firebase-admin
)@babel/core
, @babel/preset-env
, @babel/preset-typescript
, @typescript-eslint/eslint-plugin
, @typescript-eslint/parser
, eslint
, typescript
).github/workflows/deploy.yml
actions/checkout v3
actions/setup-node v3
SpicyPizza/create-envfile v1
google-github-actions/auth v1
google-github-actions/deploy-appengine v1
.github/workflows/nodejs.yml
actions/checkout v3
actions/setup-node v3
actions/checkout v3
actions/setup-node v3
actions/checkout v3
actions/setup-node v3
actions/checkout v3
actions/setup-node v3
package.json
@apollo/server ^4.1.1
@google-cloud/debug-agent 7.2.2
@slack/web-api 6.8.1
async 3.2.4
body-parser ^1.20.1
cross-env ^7.0.3
dotenv 16.0.3
express 4.18.2
firebase-admin 11.7.0
glob 8.1.0
graphql ^16.6.0
graphql-rate-limit-directive ^1.3.0
graphql-tag ^2.12.6
graphql-upload ^13.0.0
lodash ^4.17.21
mongodb 4.16.0
node-cron 3.0.2
path 0.12.7
request 2.88.2
request-promise 4.2.6
tsconfig-paths ^4.1.0
@babel/core 7.21.4
@babel/preset-env 7.21.4
@babel/preset-typescript 7.21.4
@graphql-codegen/cli 2.16.5
@graphql-codegen/typescript 2.8.8
@graphql-codegen/typescript-resolvers 2.7.13
@shelf/jest-mongodb ^4.1.3
@types/express 4.17.17
@types/graphql-upload ^8.0.12
@types/jest ^29.1.1
@types/lodash ^4.14.184
@types/mongodb 4.0.6
@typescript-eslint/eslint-plugin 5.58.0
@typescript-eslint/parser 5.58.0
babel-jest ^29.1.2
babel-plugin-transform-es2015-modules-commonjs 6.26.2
casual 1.6.2
eslint 8.38.0
jest ^29.1.2
ts-node ^10.9.1
ts-node-dev 2.0.0
typescript 5.0.4
Words that have both regular and irregular forms only show one or the other. See 걷다 for an example.
According to the App Engine docs, we get 28 hours/day for free on "F" instances, regardless of size. Currently the server uses the smallest instance, F1. Since we're already hitting the RAM limit of F1 instances, we should upgrade to a larger size like F4 which will hopefully cut down on multiple instances being created.
Using the credentials
attribute is now deprecated:
Warning: "credentials" input has been deprecated. Please switch to using google-github-actions/auth which supports both Workload Identity Federation and JSON Key authentication. For more details, see https://github.com/google-github-actions/deploy-appengine#authorization
We should update the deploy workflow to use the above action to authenticate with GCP.
Correct conjugation should have the form 누르러요, but output is 누러요
Some words, like 이르다 have both regular and irregular forms depending on definition/pos. The server doesn't account for that.
Searching 려
throws an undefined exception at charCodeAt
. This error was initialliy reported in the React Native app, but upon investigation it was found that the error comes from the server's search
endpoint.
A lot of the codebase contains giant files that should be broken down into smaller pieces of code (data sources, schema, resolvers, integration tests). Additionally, the Apollo integration testing code is using a deprecated package, so that should be updated as well.
The app should be using stem_lookup
, but that function needs to be modified so it can be used without redis. Currently words like 부르다 and 보다 are not searchable in there 요 forms
The search
endpoint doesn't trim queries before doing a search. In the report above, the user's search fails because they searched 만나다
instead of 마나다
.
While this error happened on an old version of Hanji (3.0.1) and has since been fixed on the front-end, the server should still trim whitespace to handle older apps and other clients in the future.
In case the report expires, here's the GraphQL query that caused the error:
{
operationName: ConjugationsQuery,
query:
query ConjugationsQuery($stem: String!, $isAdj: Boolean!, $honorific: Boolean!, $regular: Boolean, $conjugations: [String]) {
conjugations(
stem: $stem
isAdj: $isAdj
honorific: $honorific
regular: $regular
conjugations: $conjugations
) {
name
conjugation
type
tense
speechLevel
honorific
pronunciation
romanization
reasons
__typename
}
}
,
variables: {"stem":"","isAdj":false,"regular":true,"honorific":false}
}
Since we've learned that a majority of our users are in Asia (Philippines esp), it doesn't really make sense to have the server in us-central. Instead we should move it to a different region that better caters to users located in Asia.
This won't be easy however, because an app's region cannot be changed once set. We'll have to create a new app-engine setup on a new GCP account, and then keep both instances up until everyone's migrated over. Additionally, the DB should also be moved to the same region, which greatly reduces the regions we can migrate to because a lot of them require a dedicated cluster.
일러 has a short circuit in the conjugation code that's been there since the app's inception. The short circuit doesn't add any explanations, so the server returns an empty list for the conjugation. This is probably also affecting other conjugations for this adjective as well.
The last time I deployed I saw this warning:
Warning: google-github-actions/deploy-appengine is pinned at "main". We strongly advise against pinning to "@main" as it may be unstable
The warning recommended updating the line to this: uses: 'google-github-actions/deploy-appengine@v0'
Hi! Could you share a link to the origin of the Korean verb conj algorithms' repo by Dan Bravender?
For example, 이르다 can be found when searching 이르러 but not 일러. See #3
One of the words in Hanji's dictionary is 계시다
, which is for 있다
's honorific form. This words regular declarative conjugations are incorrect, as correctly pointed in this bug report. Additionally, since it's honorific by default it shouldn't have separate honorific conjugations.
There are other words like 계시다
that are only used in honorific forms, like 들리다
, so Hanji needs a good way to handle these. One solution could be to add an honorificOnly
flag to database entries, so the app knows to disable the toggle and only show honorific conjugations for that word.
Words with 있 or 없 in them are conjugated like verbs, even though they could be adjectives.
EDIT: The opposite is true for Declarative Formal Low, see #11
See 걷다, 듣다, and 춥다. 노랗다 and 낫다's 요 form is wrong too, but in a different way
We have a search server to handle English, but if someone makes a typo in Korean ( which I do a lot :), Hanji won't show any results. A spell checker should be added to the back end to handle this.
We should implement the following from apollo-server
's release notes:
⚠️ SECURITY apollo-server-core: The default configuration of Apollo Server is vulnerable to denial of service attacks via memory exhaustion. If you do not currently specify the cache option to new ApolloServer(), we strongly recommend you specify cache: 'bounded', which replaces the default in-memory unbounded cache with a 30MB in-memory cache, or disable automatic persisted queries with persistedQueries: false. Apollo Server now logs a warning in production if you do not configure the cache or disable APQs. See the docs for more details
⚠️ SECURITY apollo-server-core: Apollo Server now includes protection against CSRF and XS-Search attacks. We highly recommend enabling this feature by passing csrfPrevention: true to new ApolloServer(). If you rely on the ability to execute GraphQL operations via HTTP GET requests using a client other than Apollo Client Web, Apollo iOS, or Apollo Kotlin (formerly Apollo Android), you may need to first change the configuration of that client. See the CSRF prevention docs for more details. This vulnerability was reported by Jeffrey Hofmann; the feature was designed with advice from Luca Carettoni of Doyensec.
If you use the Search endpoint with an empty query
, the following error occurs:
Cannot read property 'hidden_padchim' of undefined
The search endpoint, and most likely other endpoints, should be updated to not allow empty strings. Likewise, the app will probably need to be updated to handle empty strings.
I created a new endpoint to migrate to in #144. Once everyone's updated to a version of Hanji that uses this endpoint instead of conjugations or favorites, we can delete both those endpoints.
See 이르다. The conjugation varies for verb and adjective forms
The code in the korean
folder is over ten years old and hasn't been touched since the conjugations were split up. It should be updated to current JavaScript standards and unused code should be deleted.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.