Squish42's picture
Adjust directory structure for multiple splits and configurations
8267d8a
_input_steps:
- step: &bluemoon
type: CsvInput
sync: main
config:
path: "original/rentry/bluemoon/bluemoon-fanbased-roleplays-1x1.csv"
fields:
conversation: 'thread_href'
from: 'message_username'
message: 'message'
_debug_steps:
- step: &extract_ooc
type: RegexExtract
description: "Extract OOC matches for examination"
config:
path: 'out/ooc_%worker%.txt'
dotAll: true
multiLine: true
escape: true
patterns: [
'\{.*\}', '\[.*?\]', '\(\(.*?(\)|\W)\)+', '^\(.*?\){1}', '\([^\(]+\)$',
'(OOC|ooc|OoC|OCC|ooc|Ooc)(:| |-|;)\n?.*?(\n|$)',
'(\n\nSee more|See more\n\n)', '^(RE|Re):.*?\n', '^NSFW:.*?\n$',
'^Note to everyone.*\)\)\n', '_*Author.*\n*_',
'x{3,}.*TEST?x*', '^- Let me.*-', '^.*\^\^;.*\){1}',
'^As the title suggests.*Littleton.', '^.*\)\)\n'
]
- step: &extract_links
type: RegexExtract
description: "Extract links for examination."
config:
path: 'out/links.txt'
escape: true
overwrite: true
patterns: [
'\[img|video.*\[\/img|video\]+',
'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+'
]
- step: &extract_trim_nonwords
type: RegexExtract
description: "Extract leading non-word data for examination."
config:
path: 'out/trim-nonwords.txt'
dotAll: true
multiLine: true
escape: true
overwrite: true
patterns: [
'^(-|,|\||\.|=|_|])\W*(s|\W)+\W(\b|\n)',
'^([w_=x]{5,}|~\+\+~)(\b|\n)',
'^(_|])+(\b|\n)', '^(\s|\.|,|\|)+'
]
- step: &strip_usernames
type: ExactReplace
pack: [ 'resources/gen/usernames.csv' ]
config:
caseSensitive: true
packedReplacements: [ 'resources/gen/usernames.csv' ]
passes:
# Collect all usernames from source data
- pass: &usernames
required:
- path: "data/rentry/bluemoon/bluemoon-fanbased-roleplays-1x1.csv"
sha512: f31d6bd278bc4211736d6aace3917cd0c1d0143bec9bf9d07054f5f9b32060e17399b6ea0935774b2271ac45a88309a60ef8eec8c4ac5283d1b353a255529cc5
steps:
- *bluemoon
- type: CsvOutput
description: "Extract usernames"
config:
path: 'out/usernames_%worker%.csv'
ignoreDuplicates: true
fields: [ 'from' ]
- type: FileConcatenate
sync: main
config:
path: 'resources/gen/usernames_all.csv'
files: [ 'out/usernames_*.csv' ]
ignoreDuplicateLines: true
eol: "\r\n"
delete: true
artifacts:
- file: 'resources/gen/usernames_all.csv'
sha512: ffcc8aa980f4d8b0cace9092280d07215337cc316cb3fa45742a5f5a735d21a31f581d27884a414df21ac99616d14c7ebec1ab68a5766c10faa4b1564ceb7c20
# Count the occurrences of usernames in messages in the source data
- pass: &count_usernames
required:
- path: "resources/gen/usernames_all.csv"
sha512: ffcc8aa980f4d8b0cace9092280d07215337cc316cb3fa45742a5f5a735d21a31f581d27884a414df21ac99616d14c7ebec1ab68a5766c10faa4b1564ceb7c20
- path: "data/rentry/bluemoon/bluemoon-fanbased-roleplays-1x1.csv"
sha512: f31d6bd278bc4211736d6aace3917cd0c1d0143bec9bf9d07054f5f9b32060e17399b6ea0935774b2271ac45a88309a60ef8eec8c4ac5283d1b353a255529cc5
steps:
- *bluemoon
- type: StatsCountOccurrences
description: "Count occurrences of usernames."
pack: [ 'resources/gen/usernames_all.csv' ]
config:
path: 'out/usernames_counted_%worker%.csv'
packedPatterns: [ 'resources/gen/usernames_all.csv' ]
countCol: 2
regex: false
min: 1
- type: StatsAddColMerge
description: "Merge username count csv files"
sync: main
config:
path: 'resources/gen/usernames.csv'
files: [ 'out/usernames_counted_*.csv' ]
cols: [ 2 ]
min: 1
artifacts:
- file: 'resources/gen/usernames.csv'