<commit_before>require 'rubygems'
require 'serialport'
 
@serial_port = "/dev/ttyACM0"
@serial_bps = 9600
 
sp = SerialPort.new(@serial_port,@serial_bps)
 
loop do
  read =  sp.read
  puts read
  sleep(1)
end<commit_msg>正規表現でわけることまでは出来た<commit_after>require 'rubygems'
require 'serialport'
 
@serial_port = "/dev/ttyACM0"
@serial_bps = 9600
 
sp = SerialPort.new(@serial_port,@serial_bps)
 
loop do
  read =  sp.read
  puts read
  /R:/ =~ read
  val = $'
  /L:/ =~ val
  val1 = $`
  val = $'
  /H:/ =~ val
  val2 = $`
  val = $'
  /B1:/ =~ val
  val3 = $`
  val = $'
  /B2:/ =~ val
  val4 = $`
  val = $'
  /B3:/ =~ val
  val5 = $`
  val6 = $'

  puts val1
  puts val2 
  puts val3
  puts val4
  puts val5
  puts val6
  puts "================="
  sleep(1)
end
{'fraction_non_alphanumeric': 0.17654808959156784, 'fraction_numerical': 0.03557312252964427, 'mean_word_length': 2.7254901960784315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2523996', 'n_tokens_mistral': 369, 'n_tokens_neox': 352, 'n_words': 71}