<commit_before>_             = require 'lodash'
classDetails  = require './lib/classDetails'
formatOptions = require './lib/formatOptions'
moduleDetails = require './lib/moduleDetails'
moduleOptions = require './lib/moduleOptions'
moduleTypes   = require './lib/moduleTypes'

module.exports = (content, options) ->
	formatOpts   = formatOptions options
	opts         = moduleOptions formatOpts, options
	modTypes     = moduleTypes opts.prefix
	content      = _.template content, opts.data if opts.data
	appName      = opts.appName
	details      = classDetails content, modTypes
	modules      = []
	contentLines = content.split '\n'

	# take the following class line
	# class Home extends Controler
	# the following will result in
	# class Home
	getTrimmedContent = (contentLines, position) ->
		row               = position.row
		start             = position.start
		lineContent       = contentLines[row]
		line              = lineContent.slice 0, position.start + 1
		contentLines[row] = line

		contentLines

	# add appName to moduleDetails
	details.forEach (detail) ->
		detail.appName = appName
		modDetails     = moduleDetails detail, opts<commit_msg>refactor(ngClassify): remove Angular artifacts only<commit_after>_             = require 'lodash'
classDetails  = require './lib/classDetails'
formatOptions = require './lib/formatOptions'
moduleDetails = require './lib/moduleDetails'
moduleOptions = require './lib/moduleOptions'
moduleTypes   = require './lib/moduleTypes'

module.exports = (content, options) ->
	formatOpts   = formatOptions options
	opts         = moduleOptions formatOpts, options
	modTypes     = moduleTypes opts.prefix
	content      = _.template content, opts.data if opts.data
	appName      = opts.appName
	details      = classDetails content, modTypes
	modules      = []
	contentLines = content.split '\n'

	# take the following class line
	# class Home extends Controler
	# the following will result in
	# class Home
	getTrimmedContent = (contentLines, position) ->
		# clone the original
		lines       = contentLines.slice 0
		row         = position.row
		start       = position.start
		end         = position.end
		lineContent = lines[row]
		characters  = lineContent.split ''

		delete characters[i] for i in [start + 1..end]

		line       = characters.join ''
		lines[row] = line

		lines

	# add appName to moduleDetails
	details.forEach (detail) ->
		detail.appName = appName
		modDetails     = moduleDetails detail, opts
{'fraction_non_alphanumeric': 0.0886178861788618, 'fraction_numerical': 0.0016260162601626016, 'mean_word_length': 3.0410509031198685, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '1114669', 'n_tokens_mistral': 705, 'n_tokens_neox': 669, 'n_words': 201}