<commit_before><commit_msg>String manipulation<commit_after>#!/usr/bin/env ruby

line = 'A Porsche! a Porsche! my kingdom for a Porsche!'
cite = 'Act V, Scene V'
speaker = '<NAME>, 2007'

# change part of a string
speaker[', 2007'] = ' III'
# why is
puts speaker
p speaker
# different?! http://stackoverflow.com/questions/1255324/p-vs-puts-in-ruby
# states p and puts are not the same, p effectively means foo.inspect

# change a char location: cite
cite[13] = 'IV'
p 'cite: ' + cite

speaker[13..15]
p speaker

# Add on a specific location
line[39, 8] = 'Porsche 911 Turbo!'
p line

# regex it
line[/Turbo!$/] = 'Targa!'
p line

line[/my/] = 'My'
p line

line[/Targa!$/] = '! This is funstuff'
p line
{'fraction_non_alphanumeric': 0.14978601997146934, 'fraction_numerical': 0.03851640513552068, 'mean_word_length': 4.014285714285714, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '3492886', 'n_tokens_mistral': 296, 'n_tokens_neox': 259, 'n_words': 90}