<commit_before>-- Standard code to make a table of units
-- First true example of a (small!) recipe.
module Drasil.TableOfUnits(table_of_units, unit_table) where

import Control.Lens ((^.))
import Data.Char (toLower)
import Prelude hiding (id)
import Language.Drasil
import Data.Drasil.Concepts.Documentation

table_of_units :: Unit s => [s] -> Section
table_of_units u = Section (S "Table of Units") [Con s1_intro, Con (unit_table u)]

s1_intro :: Contents
s1_intro = Paragraph 
  (S "The unit system used throughout is SI (Syst" :+: (F Grave 'e') :+: 
   S "me International d'Unit" :+: (F Acute 'e') :+: 
   S "s). In addition to the basic units, several derived units are" :+: 
   S " also used. For each unit, the table lists the symbol," :+: 
   S " a description and the SI name.")

unit_table :: Unit s => [s] -> Contents
unit_table u = Table
  (map (at_start) [symbol_, description])  (mkTable
  [(\x -> Sy (x ^. usymb)),
   (\x -> (x ^. defn) :+: S " (" :+: sMap (map toLower) (x ^. term) :+: S ")")
  ] u)
  (S "Table of Units") False
<commit_msg>TableOfUnits.hs use phrase.<commit_after>-- Standard code to make a table of units
-- First true example of a (small!) recipe.
module Drasil.TableOfUnits(table_of_units, unit_table) where

import Control.Lens ((^.))
import Data.Char (toLower)
import Prelude hiding (id)
import Language.Drasil
import Data.Drasil.Concepts.Documentation

table_of_units :: Unit s => [s] -> Section
table_of_units u = Section (S "Table of Units") [Con s1_intro, Con (unit_table u)]

s1_intro :: Contents
s1_intro = Paragraph 
  (S "The unit system used throughout is SI (Syst" :+: (F Grave 'e') :+: 
   S "me International d'Unit" :+: (F Acute 'e') :+: 
   S "s). In addition to the basic units, several derived units are" :+: 
   S " also used. For each unit, the table lists the symbol," :+: 
   S " a description and the SI name.")

unit_table :: Unit s => [s] -> Contents
unit_table u = Table
  (map (at_start) [symbol_, description])  (mkTable
  [(\x -> Sy (x ^. usymb)),
   (\x -> (x ^. defn) +:+ S "(" :+: sMap (map toLower) (phrase $ x ^. term) :+: S ")")
  ] u)
  (S "Table of Units") False

{'fraction_non_alphanumeric': 0.1538821328344247, 'fraction_numerical': 0.002806361085126286, 'mean_word_length': 3.6298701298701297, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '109976', 'n_tokens_mistral': 785, 'n_tokens_neox': 757, 'n_words': 275}