<commit_before>;;(s* HGG/ConvertLayerSetFile
;;; NAME
;;;   ConvertLayerSetFile -- Custom command designed to convert ls3 files into las files. (v1.0.1)
;;; COPYRIGHT
;;;   Copyright (C) 2016, <NAME>, All Rights Reserved.
;;; LICENSE
;;;   GPL
;;; TAGS
;;;   ls3, convert, las, layerset, layerstate, layer
;;; PURPOSE
;;;   This command is used to convert layer-set (.ls3) files into layer-state (.las) files. This
;;;   allows for compatibility for Goldsmith Engineering from the depreciated layer-set custom
;;;   program.
;;; AUTHOR
;;;   <NAME> <<EMAIL>>
;;; CREATION DATE
;;;   22 August 2015
;;; MODIFICATION HISTORY
;;;   08 January 2016 -- Added RoboDoc Support
;;; STATUS
;;;   Development
;;; NOTES
;;; - I have yet to find "official" specific rules in styling LISP code therefore all code follows
;;;   the Google Common Lisp Style Guide for styling rules with exceptions outlined below.
;;;
;;;   1)  Because AutoLISP doesn't have organizational structures like name-spaces and key object
;;;       types like classes or structs/enums, the colon is used to "emulate", for simplicity, a
;;;       class like structure. Typical function naming structure is as follows:
;;;
;;;         HGG:[Main-Function-Name]:[Sub-Function-Name]:[Sub-Function-Helper-Name]
;;;
;;;       Similarly for variables:
;;;
;;;         [topic]:[atom=descriptor]
;;;
;;;       It looks a little crazy but I need to know what the fuck I am working with in this crazy
;;;       language.
;;;
;;;   2) All Functions have the first letter of every word capitalized.
;;;
;;;   3) Local Constants should start and end with underscore characters.
;;;
;;; - This file also uses ROBODoc for documentation generation because of the lack of
;;;   documentation tags in AutoLisp.
;;; BUGS
;;; TODO
;;;   S.P.@12-20-15 -- Finish layer-state processing.
;;;   S.P.@01-06-16 -- Document Code.
;;;   S.P.@01-06-16 -- Implement RoboDoc Support
;;;   S.P.@01-06-16 -- Implement layer-state accessing (nth # layer-state) using global
;;;                    variables as mock enums to remove the magic numbers.
;;;   S.P.@01-06-16 -- Go through code and complete functions.
;;;   S.P.@01-06-16 -- Make flowchart of process to understand wtf is going on.
;;;   S.P.@01-06-16 -- Debug in Visual Lisp
;;; SEE ALSO
;;;   For info on the style guide:
;;;   |html https://google.github.io/styleguide/lispguide.xml
;;;   For help in understanding the documentation tags see:
;;;   |html https://rfsber.home.xs4all.nl/Robo/
;;)

;;(g* HGG/ConvertLayerSetFile/HGG:+default-las-state+
;;; NAME
;;;   Default-LAS-state -- The default layer state of LAS type.
;;; DECLARATION
(setq +default-LAS-state+ (list "" 64 7 "Continuous" -3 "Color_7" 0 0 ))
;;; TODO
;;;   S.P.@01-07-16 -- Refactor to include "HGG" mock name space.
;;)

;;(f* HGG/ConvertLayerSetFile/HGG:Convert-Ls3-File
;;; NAME
;;;   Convert-Ls3-File -- Convert a Ls3 file to a LAS file through a dialog box. (V0.0.1)
;;; PURPOSE
;;;   This function asks a user through a dialog box to specify which files they want to convert
;;;   from .ls3 to .las. Then it calls a sub function (HGG:Convert-Ls3-File:Process-Files) which
;;;   iterates through the list of files and converts them appropriately.
;;; DECLARATION
(defun HGG:Convert-Ls3-File ( / file-list default-filename)
;;; VARIABLES:
;;;   file-list -- The list of ls3 files to process.
;;;   default-filename -- 'nil' if a custom file directory is provided.
;;; EXAMPLE
;;;   :> Command: HGG:CONVERT-LS3-FILE
;;; CALLS
;;;   HGG:Convert-Ls3-File:Process-Files
;;;   LM:GETFILES
;;; TODO
;;;   S.P.@01-05-16 -- Update the behavior of default-filename to act more like a custom-file-dir-p
;;; SOURCE
  (init 1 "y" "n")
  (set ans (getkword "/nCreate files in respective directories? [Y]es [N]o:"))
  (setq default-filename (eq ans "y"))
  (setq file-list (LM:GETFILES "Layerset files to convert" "" "ls3"))
  (HGG:Convert-Ls3-File:Process-Files file-list default-filename)
  )
;;)

;;(f* HGG/ConvertLayerSetFile/HGG:Convert-Ls3-File:Process-Files
;;; NAME
;;;   HGG:Convert-Ls3-File:Process-Files -- Recusively processeses the ls3 files.
;;; PURPOSE
;;;   From a file list using the default filename, this function will recursively go through
;;;   the file list and create a LAS type file for each member in the list.<commit_msg>Added requirement to load LM module and added error checking to command line user input.<commit_after>;;(s* HGG/ConvertLayerSetFile
;;; NAME
;;;   ConvertLayerSetFile -- Custom command designed to convert ls3 files into las files. (v1.0.1)
;;; COPYRIGHT
;;;   Copyright (C) 2016, <NAME>, All Rights Reserved.
;;; LICENSE
;;;   GPL
;;; TAGS
;;;   ls3, convert, las, layerset, layerstate, layer
;;; PURPOSE
;;;   This command is used to convert layer-set (.ls3) files into layer-state (.las) files. This
;;;   allows for compatibility for Goldsmith Engineering from the depreciated layer-set custom
;;;   program.
;;; AUTHOR
;;;   <NAME> <<EMAIL>>
;;; CREATION DATE
;;;   22 August 2015
;;; MODIFICATION HISTORY
;;;   08 January 2016 -- Added RoboDoc Support
;;; STATUS
;;;   Development
;;; NOTES
;;; - I have yet to find "official" specific rules in styling LISP code therefore all code follows
;;;   the Google Common Lisp Style Guide for styling rules with exceptions outlined below.
;;;
;;;   1)  Because AutoLISP doesn't have organizational structures like name-spaces and key object
;;;       types like classes or structs/enums, the colon is used to "emulate", for simplicity, a
;;;       class like structure. Typical function naming structure is as follows:
;;;
;;;         HGG:[Main-Function-Name]:[Sub-Function-Name]:[Sub-Function-Helper-Name]
;;;
;;;       Similarly for variables:
;;;
;;;         [topic]:[atom=descriptor]
;;;
;;;       It looks a little crazy but I need to know what the fuck I am working with in this crazy
;;;       language.
;;;
;;;   2) All Functions have the first letter of every word capitalized.
;;;
;;;   3) Local Constants should start and end with underscore characters.
;;;
;;; - This file also uses ROBODoc for documentation generation because of the lack of
;;;   documentation tags in AutoLisp.
;;; BUGS
;;; TODO
;;;   S.P.@12-20-15 -- Finish layer-state processing.
;;;   S.P.@01-06-16 -- Document Code.
;;;   S.P.@01-06-16 -- Implement RoboDoc Support
;;;   S.P.@01-06-16 -- Implement layer-state accessing (nth # layer-state) using global
;;;                    variables as mock enums to remove the magic numbers.
;;;   S.P.@01-06-16 -- Go through code and complete functions.
;;;   S.P.@01-06-16 -- Make flowchart of process to understand wtf is going on.
;;;   S.P.@01-06-16 -- Debug in Visual Lisp
;;; SEE ALSO
;;;   For info on the style guide:
;;;   |html https://google.github.io/styleguide/lispguide.xml
;;;   For help in understanding the documentation tags see:
;;;   |html https://rfsber.home.xs4all.nl/Robo/
;;)

;;(g* HGG/ConvertLayerSetFile/HGG:+default-las-state+
;;; NAME
;;;   Default-LAS-state -- The default layer state of LAS type.
;;; DECLARATION
(setq +default-LAS-state+ (list "" 64 7 "Continuous" -3 "Color_7" 0 0 ))
;;; TODO
;;;   S.P.@01-07-16 -- Refactor to include "HGG" mock name space.
;;)
(load "GetFilesv1-4.lsp"
      (progn
        (princ "ERROR: GetFilesv1-4.lsp not found in load path. Function will now exit.")
        (exit)
        )
      )

;;(f* HGG/ConvertLayerSetFile/HGG:Convert-Ls3-File
;;; NAME
;;;   Convert-Ls3-File -- Convert a Ls3 file to a LAS file through a dialog box. (V0.0.1)
;;; PURPOSE
;;;   This function asks a user through a dialog box to specify which files they want to convert
;;;   from .ls3 to .las. Then it calls a sub function (HGG:Convert-Ls3-File:Process-Files) which
;;;   iterates through the list of files and converts them appropriately.
;;; DECLARATION
(defun HGG:Convert-Ls3-File ( / file-list custom-dir-p)
;;; VARIABLES:
;;;   ans -- The answer for input from the user.
;;;   file-list -- The list of ls3 files to process.
;;;   custom-dir-p -- 'nil' if a custom file directory is requested.
;;; EXAMPLE
;;;   :> Command: HGG:CONVERT-LS3-FILE
;;; CALLS
;;;   HGG:Convert-Ls3-File:Process-Files
;;;   LM:GETFILES
;;; TODO
;;; SOURCE
  (initget "Yes" "No")
  (set ans (getkword "/nCreate files in respective directories? [Y]es [N]o, default is Yes:"))
  (setq custom-dir-p (if (or (= ans "Yes") (not ans) ) nil ans))
  (setq file-list (LM:GETFILES "Layerset files to convert" "" "ls3"))
  (HGG:Convert-Ls3-File:Process-Files file-list custom-dir-p)
  )
;;)

;;(f* HGG/ConvertLayerSetFile/HGG:Convert-Ls3-File:Process-Files
;;; NAME
;;;   HGG:Convert-Ls3-File:Process-Files -- Recusively processeses the ls3 files.
;;; PURPOSE
;;;   From a file list using the default filename, this function will recursively go through
;;;   the file list and create a LAS type file for each member in the list.
{'fraction_non_alphanumeric': 0.14337568058076225, 'fraction_numerical': 0.023480036297640654, 'mean_word_length': 3.498469387755102, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 2, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4015621', 'n_tokens_mistral': 3079, 'n_tokens_neox': 2901, 'n_words': 992}