Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
dogweather committed Dec 13, 2023
1 parent ff71152 commit 5971e64
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/news/article.ex
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,24 @@ defmodule News.Article do
html
|> simple_cites(~r/Ore. Rev. Stat. § (\d+[A-Z]?\.\d+[A-Z]?)/, &("ORS #{&1}"))

ny_penal_law_cites =
html
|> simple_cites(~r/NY Penal Law § (\d+\.\d+)/, &("NY Penal Law Section #{&1}"))

tx_cites_from_text =
Regex.scan(~r/(Texas \w+ Code Section [\d\w.]+)/, html)
|> flatten()
|> map(fn m -> String.replace(m, "Texas ", "Tex. ") end)
|> map(fn m -> String.replace(m, "Family ", "Fam. ") end)
|> map(fn m -> String.replace(m, "Transportation ", "Transp. ") end)

crs_cites_from_text_1
++ crs_cites_from_text_2
++ crs_cites_from_text_3
++ tx_cites_from_text
++ nrs_cites
++ ors_cites
crs_cites_from_text_1
++ crs_cites_from_text_2
++ crs_cites_from_text_3
++ tx_cites_from_text
++ nrs_cites
++ ors_cites
++ ny_penal_law_cites
end


Expand Down

0 comments on commit 5971e64

Please sign in to comment.