Lightweight package for checking HSK levels of characters. Provides ways to check the HSK level of characters. Note the focus is on characters, not words. There are other utilities which are smarter, and better suited to analyzing words.
const hskChars = require('hsk-chars');
const average = hskChars.getAverageHskLevel('定其主理心人一个人人');
// 2 because half of the characters are HSK 1 and half are HSK 3.
The format is hsk-chars METHOD STRING
where METHOD is the method name.
$ hsk-chars getMaxHskLevel 还要一个包冤
6
For methods that take an argument, pass it before the string:
$ hsk-chars isAtOrBelowLevel -l 2 还要一个
true
In all cases, level
can be 1-6.
isOnlyHskLevel(level, string)
Returns true if string
is exactly the level
specified. If it is below the level, or above, return false.
isAtOrBelowLevel(level, string)
Returns true if string
is entirely at or below the level
specified.
getMaxHskLevel(string)
Returns the maximum HSK level found in string.
getAverageHskLevel(string)
Returns an average level based on the characters in the string.
Run npm run publish:patch
(or minor
, major
) to publish.