<commit_before>/*
  for use external analyzer in misskey.
  service: https://github.com/prezzemolo/analizzatore
*/
$ = require 'jquery'

desc-cutter = (desc, length) ->
	if desc.length > length
	then "#{desc.substr(length)}..."
	else desc

weserv-url-gen = (url) ->
	url-obj = new URL url
	\https://images.weserv.nl/?url= + url-obj.href.substr url-obj.protocol.length + 2

module.exports = (url) -> new Promise (res, rej) !->
	$.ajax "https://analizzatore.prezzemolo.ga/" {
		type: \get
		data:
			'url': url
		-global
		+cache<commit_msg>use the global LANG variable for analyzer<commit_after>/*
  for use external analyzer in misskey.
  service: https://github.com/prezzemolo/analizzatore
*/
$ = require 'jquery'

desc-cutter = (desc, length) ->
	if desc.length > length
	then "#{desc.substr(length)}..."
	else desc

weserv-url-gen = (url) ->
	url-obj = new URL url
	\https://images.weserv.nl/?url= + url-obj.href.substr url-obj.protocol.length + 2

module.exports = (url) -> new Promise (res, rej) !->
	$.ajax "https://analizzatore.prezzemolo.ga/" {
		type: \get
		data:
			url: url
			lang: LANG
		-global
		+cache
{'fraction_non_alphanumeric': 0.1708407871198569, 'fraction_numerical': 0.0017889087656529517, 'mean_word_length': 3.2386363636363638, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2749265', 'n_tokens_mistral': 436, 'n_tokens_neox': 414, 'n_words': 99}