Skip to content

Commit

Permalink
Delete unsentenced - Public update
Browse files Browse the repository at this point in the history
  • Loading branch information
llorracc committed Oct 6, 2024
1 parent 580fc2c commit e027272
Show file tree
Hide file tree
Showing 295 changed files with 1,544 additions and 82,400 deletions.
Empty file modified @resources/bash/@resources-update-from-remote.sh
100644 β†’ 100755
Empty file.
Empty file.
15 changes: 11 additions & 4 deletions @resources/bash/split-to-sentences-all-tex-files.sh
100644 β†’ 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
process_file() {
input_file="$1"
python "$script_dir/split-to-sentences.py" "$input_file"

# Compare the contents of the original file and the 'sentenced' file
if cmp -s "$input_file" "${input_file%.tex}-sentenced.tex"; then
# If the files are identical, remove the 'sentenced' file
rm "${input_file%.tex}-sentenced.tex"
echo "No changes made to file: $input_file"
else
echo "Processed file saved as: ${input_file%.tex}-sentenced.tex"
fi
}

# Get the directory of the Bash script
Expand Down Expand Up @@ -67,11 +76,10 @@ if $all_files; then
for file in "${tex_files[@]}"; do
echo "Processing file: $file"
process_file "$file"
if $replace_original; then
if $replace_original && [ -f "${file%.tex}-sentenced.tex" ]; then
mv "$file" "${file%.tex}-unsentenced.tex"
mv "${file%.tex}-sentenced.tex" "$file"
fi
echo "Processed file saved as: ${file%.tex}-sentenced.tex"
echo "------------------------"
done
echo "All .tex files in the directory have been processed."
Expand All @@ -92,9 +100,8 @@ else
# Process the specified file
echo "Processing file: $filename"
process_file "$filename"
if $replace_original; then
if $replace_original && [ -f "${filename%.tex}-sentenced.tex" ]; then
mv "$filename" "${filename%.tex}-unsentenced.tex"
mv "${filename%.tex}-sentenced.tex" "$filename"
fi
echo "Processed file saved as: ${filename%.tex}-sentenced.tex"
fi
6 changes: 4 additions & 2 deletions @resources/bash/split-to-sentences.py
100644 β†’ 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# see Claude prompt "Sentence" for development
# 20241002:
# - add '.} ' and '.) ' as sentencers
# 20241006:
# - remove bad sentence_patterns

import re
import sys
import os
Expand Down Expand Up @@ -31,8 +35,6 @@ def add_newlines(text):
placeholder_line = re.sub(pattern, '__PLACEHOLDER__', line)

# Regular expression pattern to match sentence endings
sentence_pattern = r'(?:[.!?]|\.\'|\.\"|\$\.)\s+'
sentence_pattern = r'(?:[.!?]|\.\'|\.\"|\$\.|\.}\s)\s+' # add '.} '
sentence_pattern = r'(?:[.!?]|\.\'|\.\"|\$\.|\.\)\s|\.}\s)\s+' # add '.) '

# Replace sentence endings with newline character only if there is further non-whitespace material on the line
Expand Down
Empty file modified @resources/bash/split-to-sentences.sh
100644 β†’ 100755
Empty file.
15 changes: 11 additions & 4 deletions @resources/shell/split-to-sentences-all-tex-files.sh
100644 β†’ 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
process_file() {
input_file="$1"
python "$script_dir/split-to-sentences.py" "$input_file"

# Compare the contents of the original file and the 'sentenced' file
if cmp -s "$input_file" "${input_file%.tex}-sentenced.tex"; then
# If the files are identical, remove the 'sentenced' file
rm "${input_file%.tex}-sentenced.tex"
echo "No changes made to file: $input_file"
else
echo "Processed file saved as: ${input_file%.tex}-sentenced.tex"
fi
}

# Get the directory of the Bash script
Expand Down Expand Up @@ -67,11 +76,10 @@ if $all_files; then
for file in "${tex_files[@]}"; do
echo "Processing file: $file"
process_file "$file"
if $replace_original; then
if $replace_original && [ -f "${file%.tex}-sentenced.tex" ]; then
mv "$file" "${file%.tex}-unsentenced.tex"
mv "${file%.tex}-sentenced.tex" "$file"
fi
echo "Processed file saved as: ${file%.tex}-sentenced.tex"
echo "------------------------"
done
echo "All .tex files in the directory have been processed."
Expand All @@ -92,9 +100,8 @@ else
# Process the specified file
echo "Processing file: $filename"
process_file "$filename"
if $replace_original; then
if $replace_original && [ -f "${filename%.tex}-sentenced.tex" ]; then
mv "$filename" "${filename%.tex}-unsentenced.tex"
mv "${filename%.tex}-sentenced.tex" "$filename"
fi
echo "Processed file saved as: ${filename%.tex}-sentenced.tex"
fi
6 changes: 4 additions & 2 deletions @resources/shell/split-to-sentences.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# see Claude prompt "Sentence" for development
# 20241002:
# - add '.} ' and '.) ' as sentencers
# 20241006:
# - remove bad sentence_patterns

import re
import sys
import os
Expand Down Expand Up @@ -31,8 +35,6 @@ def add_newlines(text):
placeholder_line = re.sub(pattern, '__PLACEHOLDER__', line)

# Regular expression pattern to match sentence endings
sentence_pattern = r'(?:[.!?]|\.\'|\.\"|\$\.)\s+'
sentence_pattern = r'(?:[.!?]|\.\'|\.\"|\$\.|\.}\s)\s+' # add '.} '
sentence_pattern = r'(?:[.!?]|\.\'|\.\"|\$\.|\.\)\s|\.}\s)\s+' # add '.) '

# Replace sentence endings with newline character only if there is further non-whitespace material on the line
Expand Down
17 changes: 17 additions & 0 deletions @resources/texlive/texmf-local/tex/latex/unicode-subs-declare.sty
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
% If you encounter the unicode character, substitute the LaTeX on compile
\DeclareUnicodeCharacter{1D53C}{\mathbb{E}} % 𝔼
\DeclareUnicodeCharacter{1D41A}{\mathbf{a}} % 𝐚
\DeclareUnicodeCharacter{1D41B}{\mathbf{b}} % 𝐛
\DeclareUnicodeCharacter{1D41C}{\mathbf{c}} % 𝐜
\DeclareUnicodeCharacter{1D429}{\mathbf{p}} % 𝐩
\DeclareUnicodeCharacter{1D424}{\mathbf{k}} % 𝐀
\DeclareUnicodeCharacter{1D426}{\mathbf{m}} % 𝐦
\DeclareUnicodeCharacter{1D42F}{\mathbf{v}} % 𝐯
\DeclareUnicodeCharacter{1D432}{\mathbf{y}} % 𝐲
\DeclareUnicodeCharacter{1D4A2}{\mathcal{G}} % 𝒒
\DeclareUnicodeCharacter{211B}{\mathcal{R}} % β„›
\DeclareUnicodeCharacter{1D69E}{\mathrm{u}} % 𝚞
\DeclareUnicodeCharacter{1D69F}{\mathrm{v}} % 𝚟
\DeclareUnicodeCharacter{03B2}{\beta} % Ξ²
\DeclareUnicodeCharacter{03C3}{\sigma} % Οƒ
\DeclareUnicodeCharacter{03C1}{\rho} % ρ
17 changes: 17 additions & 0 deletions @resources/texlive/texmf-local/tex/latex/unicode-subs-declare.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
% If you encounter the unicode character, substitute the LaTeX on compile
\DeclareUnicodeCharacter{1D53C}{\mathbb{E}} % 𝔼
\DeclareUnicodeCharacter{1D41A}{\mathbf{a}} % 𝐚
\DeclareUnicodeCharacter{1D41B}{\mathbf{b}} % 𝐛
\DeclareUnicodeCharacter{1D41C}{\mathbf{c}} % 𝐜
\DeclareUnicodeCharacter{1D429}{\mathbf{p}} % 𝐩
\DeclareUnicodeCharacter{1D424}{\mathbf{k}} % 𝐀
\DeclareUnicodeCharacter{1D426}{\mathbf{m}} % 𝐦
\DeclareUnicodeCharacter{1D42F}{\mathbf{v}} % 𝐯
\DeclareUnicodeCharacter{1D432}{\mathbf{y}} % 𝐲
\DeclareUnicodeCharacter{1D4A2}{\mathcal{G}} % 𝒒
\DeclareUnicodeCharacter{211B}{\mathcal{R}} % β„›
\DeclareUnicodeCharacter{1D69E}{\mathrm{u}} % 𝚞
\DeclareUnicodeCharacter{1D69F}{\mathrm{v}} % 𝚟
\DeclareUnicodeCharacter{03B2}{\beta} % Ξ²
\DeclareUnicodeCharacter{03C3}{\sigma} % Οƒ
\DeclareUnicodeCharacter{03C1}{\rho} % ρ
Empty file modified Appendices/@resources/bash/@resources-update-from-remote.sh
100644 β†’ 100755
Empty file.
Empty file.
15 changes: 11 additions & 4 deletions Appendices/@resources/bash/split-to-sentences-all-tex-files.sh
100644 β†’ 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
process_file() {
input_file="$1"
python "$script_dir/split-to-sentences.py" "$input_file"

# Compare the contents of the original file and the 'sentenced' file
if cmp -s "$input_file" "${input_file%.tex}-sentenced.tex"; then
# If the files are identical, remove the 'sentenced' file
rm "${input_file%.tex}-sentenced.tex"
echo "No changes made to file: $input_file"
else
echo "Processed file saved as: ${input_file%.tex}-sentenced.tex"
fi
}

# Get the directory of the Bash script
Expand Down Expand Up @@ -67,11 +76,10 @@ if $all_files; then
for file in "${tex_files[@]}"; do
echo "Processing file: $file"
process_file "$file"
if $replace_original; then
if $replace_original && [ -f "${file%.tex}-sentenced.tex" ]; then
mv "$file" "${file%.tex}-unsentenced.tex"
mv "${file%.tex}-sentenced.tex" "$file"
fi
echo "Processed file saved as: ${file%.tex}-sentenced.tex"
echo "------------------------"
done
echo "All .tex files in the directory have been processed."
Expand All @@ -92,9 +100,8 @@ else
# Process the specified file
echo "Processing file: $filename"
process_file "$filename"
if $replace_original; then
if $replace_original && [ -f "${filename%.tex}-sentenced.tex" ]; then
mv "$filename" "${filename%.tex}-unsentenced.tex"
mv "${filename%.tex}-sentenced.tex" "$filename"
fi
echo "Processed file saved as: ${filename%.tex}-sentenced.tex"
fi
6 changes: 4 additions & 2 deletions Appendices/@resources/bash/split-to-sentences.py
100644 β†’ 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# see Claude prompt "Sentence" for development
# 20241002:
# - add '.} ' and '.) ' as sentencers
# 20241006:
# - remove bad sentence_patterns

import re
import sys
import os
Expand Down Expand Up @@ -31,8 +35,6 @@ def add_newlines(text):
placeholder_line = re.sub(pattern, '__PLACEHOLDER__', line)

# Regular expression pattern to match sentence endings
sentence_pattern = r'(?:[.!?]|\.\'|\.\"|\$\.)\s+'
sentence_pattern = r'(?:[.!?]|\.\'|\.\"|\$\.|\.}\s)\s+' # add '.} '
sentence_pattern = r'(?:[.!?]|\.\'|\.\"|\$\.|\.\)\s|\.}\s)\s+' # add '.) '

# Replace sentence endings with newline character only if there is further non-whitespace material on the line
Expand Down
Empty file modified Appendices/@resources/bash/split-to-sentences.sh
100644 β†’ 100755
Empty file.
15 changes: 11 additions & 4 deletions Appendices/@resources/shell/split-to-sentences-all-tex-files.sh
100644 β†’ 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
process_file() {
input_file="$1"
python "$script_dir/split-to-sentences.py" "$input_file"

# Compare the contents of the original file and the 'sentenced' file
if cmp -s "$input_file" "${input_file%.tex}-sentenced.tex"; then
# If the files are identical, remove the 'sentenced' file
rm "${input_file%.tex}-sentenced.tex"
echo "No changes made to file: $input_file"
else
echo "Processed file saved as: ${input_file%.tex}-sentenced.tex"
fi
}

# Get the directory of the Bash script
Expand Down Expand Up @@ -67,11 +76,10 @@ if $all_files; then
for file in "${tex_files[@]}"; do
echo "Processing file: $file"
process_file "$file"
if $replace_original; then
if $replace_original && [ -f "${file%.tex}-sentenced.tex" ]; then
mv "$file" "${file%.tex}-unsentenced.tex"
mv "${file%.tex}-sentenced.tex" "$file"
fi
echo "Processed file saved as: ${file%.tex}-sentenced.tex"
echo "------------------------"
done
echo "All .tex files in the directory have been processed."
Expand All @@ -92,9 +100,8 @@ else
# Process the specified file
echo "Processing file: $filename"
process_file "$filename"
if $replace_original; then
if $replace_original && [ -f "${filename%.tex}-sentenced.tex" ]; then
mv "$filename" "${filename%.tex}-unsentenced.tex"
mv "${filename%.tex}-sentenced.tex" "$filename"
fi
echo "Processed file saved as: ${filename%.tex}-sentenced.tex"
fi
6 changes: 4 additions & 2 deletions Appendices/@resources/shell/split-to-sentences.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# see Claude prompt "Sentence" for development
# 20241002:
# - add '.} ' and '.) ' as sentencers
# 20241006:
# - remove bad sentence_patterns

import re
import sys
import os
Expand Down Expand Up @@ -31,8 +35,6 @@ def add_newlines(text):
placeholder_line = re.sub(pattern, '__PLACEHOLDER__', line)

# Regular expression pattern to match sentence endings
sentence_pattern = r'(?:[.!?]|\.\'|\.\"|\$\.)\s+'
sentence_pattern = r'(?:[.!?]|\.\'|\.\"|\$\.|\.}\s)\s+' # add '.} '
sentence_pattern = r'(?:[.!?]|\.\'|\.\"|\$\.|\.\)\s|\.}\s)\s+' # add '.) '

# Replace sentence endings with newline character only if there is further non-whitespace material on the line
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
% If you encounter the unicode character, substitute the LaTeX on compile
\DeclareUnicodeCharacter{1D53C}{\mathbb{E}} % 𝔼
\DeclareUnicodeCharacter{1D41A}{\mathbf{a}} % 𝐚
\DeclareUnicodeCharacter{1D41B}{\mathbf{b}} % 𝐛
\DeclareUnicodeCharacter{1D41C}{\mathbf{c}} % 𝐜
\DeclareUnicodeCharacter{1D429}{\mathbf{p}} % 𝐩
\DeclareUnicodeCharacter{1D424}{\mathbf{k}} % 𝐀
\DeclareUnicodeCharacter{1D426}{\mathbf{m}} % 𝐦
\DeclareUnicodeCharacter{1D42F}{\mathbf{v}} % 𝐯
\DeclareUnicodeCharacter{1D432}{\mathbf{y}} % 𝐲
\DeclareUnicodeCharacter{1D4A2}{\mathcal{G}} % 𝒒
\DeclareUnicodeCharacter{211B}{\mathcal{R}} % β„›
\DeclareUnicodeCharacter{1D69E}{\mathrm{u}} % 𝚞
\DeclareUnicodeCharacter{1D69F}{\mathrm{v}} % 𝚟
\DeclareUnicodeCharacter{03B2}{\beta} % Ξ²
\DeclareUnicodeCharacter{03C3}{\sigma} % Οƒ
\DeclareUnicodeCharacter{03C1}{\rho} % ρ
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
% If you encounter the unicode character, substitute the LaTeX on compile
\DeclareUnicodeCharacter{1D53C}{\mathbb{E}} % 𝔼
\DeclareUnicodeCharacter{1D41A}{\mathbf{a}} % 𝐚
\DeclareUnicodeCharacter{1D41B}{\mathbf{b}} % 𝐛
\DeclareUnicodeCharacter{1D41C}{\mathbf{c}} % 𝐜
\DeclareUnicodeCharacter{1D429}{\mathbf{p}} % 𝐩
\DeclareUnicodeCharacter{1D424}{\mathbf{k}} % 𝐀
\DeclareUnicodeCharacter{1D426}{\mathbf{m}} % 𝐦
\DeclareUnicodeCharacter{1D42F}{\mathbf{v}} % 𝐯
\DeclareUnicodeCharacter{1D432}{\mathbf{y}} % 𝐲
\DeclareUnicodeCharacter{1D4A2}{\mathcal{G}} % 𝒒
\DeclareUnicodeCharacter{211B}{\mathcal{R}} % β„›
\DeclareUnicodeCharacter{1D69E}{\mathrm{u}} % 𝚞
\DeclareUnicodeCharacter{1D69F}{\mathrm{v}} % 𝚟
\DeclareUnicodeCharacter{03B2}{\beta} % Ξ²
\DeclareUnicodeCharacter{03C3}{\sigma} % Οƒ
\DeclareUnicodeCharacter{03C1}{\rho} % ρ
Loading

0 comments on commit e027272

Please sign in to comment.