Skip to content

Feature: Line counter tool updates

This feature adds two command-line switches for the XML unique line counter tool, based on @Dilettante's comments from here and here.

This also renames the output file from "output.log" to the slightly more descriptive "line_count.log".

Passing -o or --output, followed by a directory path, should now generate the line_count.log file to a directory of the user's choosing. For example, assuming the user is currently in the opponents directory:

python xml_unique_line_counter.py -f buffy\behaviour.xml -o C:\Users\yourusername\Documents

will generate a line_count.log file for Buffy's dialogue and place it in the user's Documents folder. Leaving out the -o switch will place the file in the current directly, as normal.

Passing -s or --sortfreq will order the lines in line_count.log by highest frequency, so the most frequent lines should appear first.

python xml_unique_line_counter.py -f buffy\behaviour.xml -s

Finally, the .gitignore file was updated to ignore all files named "line_count.log", so now even if you generate it within the repo, it shouldn't be picked up by git.

Merge request reports

Loading