<commit_before>#
# Traverser sandbox for em-files.
#
#   Date: Nov 13, 2010
# Author: <NAME>
#

ifndef __embuild_traverse_emfile_mk
__embuild_traverse_emfile_mk := 1

include util/common.mk
include util/var_filter.mk
include util/var_assign.mk
include util/log.mk

include embuild/traverse/entity.mk

# Wrapper around generic error logger.
# Params:
#  1. Error message
emfile_error = $(call log_error,emfile,$(__emfile),[emfile] $1)

# Called for each user defined variable by var_filter_out. Detects double word
# variable names and tries to interpret them as entities.
# Params:
#  1. Variable name as is
emfile_handle_variable = \
  $(if $(filter-out 2,$(words $1)), \
    $(call emfile_error,Invalid em-file variable: $1), \
    $(call emfile_handle_variable_maybe_entity,$(word 1,$1),$(word 2,$1),$1) \
  )<commit_msg>#228: distinguish single (*.em) and multiple (Embuild) emfiles<commit_after>#
# Traverser sandbox for em-files.
#
#   Date: Nov 13, 2010
# Author: <NAME>
#

ifndef __embuild_traverse_emfile_mk
__embuild_traverse_emfile_mk := 1

include util/common.mk
include util/var_filter.mk
include util/var_assign.mk
include util/log.mk

include embuild/traverse/entity.mk

# Wrapper around generic error logger.
# Params:
#  1. Error message
emfile_error = $(call log_error,emfile,$(__emfile),[emfile] $1)

# Returns:
#   'single'   for *.em, and
#   'multiple' for Embuild
emfile_type = $(call __emfile_type,$($(notdir $(__emfile))))
__emfile_type = \
  $(if $(filter 1,$(words $1)),$ \
    $(if $(filter Embuild,$1),common,$ \
       $(if $(filter %.em,$1),personal,$ \
         $(error invalid emfile: __emfile is [$(__emfile)]))))

# Called for each user defined variable by var_filter_out. Detects double word
# variable names and tries to interpret them as entities.
# Params:
#  1. Variable name as is
emfile_handle_variable = \
  $(if $(filter-out 2,$(words $1)), \
    $(call emfile_error,Invalid em-file variable: $1), \
    $(call emfile_handle_variable_maybe_entity,$(word 1,$1),$(word 2,$1),$1) \
  )
{'fraction_non_alphanumeric': 0.13919052319842054, 'fraction_numerical': 0.021224086870681145, 'mean_word_length': 4.538251366120218, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '944278', 'n_tokens_mistral': 736, 'n_tokens_neox': 707, 'n_words': 192}