citation-form
A script to help Mac users abbreviate case names in legal citations
Science Score: 18.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.9%) to scientific vocabulary
Repository
A script to help Mac users abbreviate case names in legal citations
Basic Info
Statistics
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
- Releases: 0
Metadata Files
README.markdown
Citation Form
This is a simple Apple services menu item to help abbreviate case names in legal citations.
I take no responsibility for the wisdom or the quality of these abbreviations. Some are amazingly ugly; many are nearly inscrutable. But these are patterned from the canonical list that other lawyers follow. And as with many things in our fashion-focused profession, we value staying with the pack, even when it hurts.
The current version of this list was coded by hand for my own use; it does not reflect anyone's official style. A future version of this script will adopt the abbreviations table from The Indigo Book.
Who can use this?
You need to:
be a Mac OS X user (with a system version of at least 10.6);
be willing to walk through a brief installation process (more than one click, but not much more); and
use software that is friendly to the built-in Services menu, such as Apple's Pages word processor or a recent version of Microsoft Word.
I've confirmed that this script works in Pages and in the latest version of Microsoft Word, running on the latest version of the Mac OS (El Capitan).
How to install
You will be creating a new entry in the "Services" menu, which appears in the menu in compatible applications. This is done using Automator, which comes installed by default.
Open the Automator program (which is easiest to find through spotlight search). Now select "Service" as what you're trying to create.
The default should be a text-based service. That's correct. Please also check the box signaling that you want to "replace selected text."
From the library of possible actions on the left, find the entry for "Run Shell Script." Then drag that over to the work area on the right.
I wrote my script in a language called Ruby. So you want to select "/usr/bin/ruby" from that little drop-down menu on the right.
Copy the text of the script
citation-form.rband paste those contents into the script editing box just below the selections you've just made, replacing the placeholder text (the text that by default beginsARGF). If you are reading this on the web, you can get to that code directly through this link. If you have downloaded this repository, be sure to do the copying-and-pasting from a text editor that does not insert extra characters that might confuse the code. (TextEdit works fine; Word likely does not).You are almost done. Save this automator action as you would any other file (by using command-S using the File menu), giving it the name you want to appear in the Services menu. I chose "Abbreviate Case Name"; you can choose whatever you'd like.
At this point, you can access the script by using the menus. If you'd like to have a keyboard shortcut, then there is one more step to take.
- (Optional) Now open up the System Preferences pane, choose Keyboard, then make a new keyboard shortcut for this service. (I chose
ctrl-option-command-C, which is natural to type on my laptop keyboard and doesn't conflict with other shortcuts built into my word processor.)
How to use it
Just highlight the case name — and only the case name — and invoke the service.
With a shortcut. If you added a keyboard shortcut, just hit your key combination. (Mine is
control-option-command-C, the three keys to the left of my Mac laptop keyboard and the letterC.)Without a shortcut. First, highlight the text you want to abbreviate. Second, look at the menu bar (at the very top of the Mac screen) for the name of your application you are using (such as Word or Pages), click that, and find the entry for
Servicesin the drop-down menu. If you have selected some text, you should see the name of the service you chose in Step 5 above (I chose "Abbreviate Case Name"). Select that, and your text should be abbreviated.
Do not point this script at other text besides case names, especially not text you care about (such as the rest of your brief).
Note: The apostrophes in the abbreviations show up as what people commonly refer to as "dumb" quotes. You should glance at the cites to see if you need to "smarten" them up.
Troubleshooting
If you don't see anything, then either (a) you don't have any text highlighted or selected; (b) you're using software that does not support Services (do any services appear when you select text?); or (c) there was a problem with your installation.
Fixing (a) is easy. Fixing (b) requires a different software developer to address your problem. Fixing (c) might be tricky. If you have problems with it, please first try repeating the steps above. If that still doesn't work, please open an "Issue" or send me an email.
How to suggest edits
I am particularly interested in errors that prickle the sensibility of freshly minted law clerks, such as deviations from the canons of legal citations.
If you see an error, feel free to contact me directly. My email address and twitter handle are available on my Github profile page (http://github.com/doncruse). Or, if you are a member of Github, feel free to submit any errors on the "Issues" page using the menu at the top of this page. That lets other users know that a particular error has been reported, and it lets you track the progress of any fix.
Owner
- Name: Don Cruse
- Login: doncruse
- Kind: user
- Location: Austin, TX
- Website: https://appellate.social/@doncruse
- Twitter: doncruse
- Repositories: 15
- Profile: https://github.com/doncruse
Citation (citation-form.rb)
#!/usr/bin/ruby
#
# Original version August 18, 2010
# by Don Cruse
# http://github.com/doncruse/citation-form
#
# If you want to know more about my projects, I write about
# them on my law blog (http://www.scotxblog.com).
#
# This program is fully open source & free under the MIT license
# License: http://www.opensource.org/licenses/mit-license.php
#
# You are free to modify this as you wish.
# This is what is known as a "hash." Each word on the left
# is mapped to one abbreviation. I chose lowercase to make
# the matching process a little simpler.
WORDS = {
"academy" => "Acad.",
"academies" => "Acads.",
"administrative" => "Admin.",
"administration" => "Admin.",
"administrator" => "Adm'r",
"administrators" => "Adm'rs",
"administratrix" => "Adm'x",
"advertising" => "Adver.",
"agriculture" => "Agric.",
"agricultural" => "Agric.",
"america" => "Am.",
"american" => "Am.",
"and" => "&",
"associate" => "Assoc.",
"associates" => "Assocs.",
"association" => "Assoc.",
"associations" => "Assocs.",
"atlantic" => "Atl.",
"authority" => "Auth.",
"authorities" => "Auths.",
"automobile" => "Auto.",
"automotive" => "Auto.",
"automobiles" => "Autos.",
"avenue" => "Ave.",
"avenues" => "Aves.",
"board" => "Bd.",
"boards" => "Bds.",
"broadcast" => "Broad.",
"brotherhood" => "Bhd.",
"brotherhoods" => "Bhds.",
"broadcasting" => "Broad.",
"bankruptcy" => "Bankr.",
"brothers" => "Bros.",
"building" => "Bldg.",
"buildings" => "Bldgs.",
"business" => "Bus.",
"businesses" => "Bus.",
"casualty" => "Cas.",
"center" => "Ctr.",
"centre" => "Ctr.",
"centers" => "Ctrs.",
"centres" => "Ctrs.",
"central" => "Cent.",
"chemical" => "Chem.",
"chemicals" => "Chems.",
"coalition" => "Coal.",
"coalitions" => "Coals.",
"college" => "Coll.",
"colleges" => "Colls.",
"commission" => "Comm'n",
"commissions" => "Comm'ns",
"commissioner" => "Comm'r",
"commissioners" => "Comm'rs",
"committee" => "Comm.",
"committees" => "Comms.",
"communication" => "Commc'n",
"communications" => "Commc'ns",
"community" => "Cmty.",
"communities" => "Cmtys.",
"company" => "Co.",
"companies" => "Cos.",
"compensation" => "Comp.",
"condominium" => "Condo.",
"condominiums" => "Condos.",
"congress" => "Cong.",
"congressional" => "Cong.",
"congresses" => "Congs.",
"consolidated" => "Consol.",
"consolidateds" => "Consols.",
"construction" => "Constr.",
"constructions" => "Constrs.",
"continental" => "Cont'l",
"cooperative" => "Coop.",
"cooperatives" => "Coops.",
"corporation" => "Corp.",
"corporations" => "Corps.",
"correction" => "Corr.",
"corrections" => "Corr.",
"correctional" => "Corr.",
"defense" => "Def.",
"department" => "Dep't",
"detention" => "Det.",
"development" => "Dev.",
"developments" => "Devs.",
"director" => "Dir.",
"directors" => "Dirs.",
"discount" => "Disc.",
"discounts" => "Discs.",
"distributor" => "Distrib.",
"distributors" => "Distribs.",
"distributing" => "Distrib.",
"district" => "Dist.",
"districts" => "Dists.",
"division" => "Div.",
"divisions" => "Divs.",
"east" => "E.",
"eastern" => "E.",
"economic" => "Econ.",
"economics" => "Econ.",
"economical" => "Econ.",
"economy" => "Econ.",
"economies" => "Econs.",
"education" => "Educ.",
"educational" => "Educ.",
"electric" => "Elec.",
"electrical" => "Elec.",
"electricity" => "Elec.",
"electronic" => "Elec.",
"electronics" => "Elecs.",
"engineer" => "Eng'r",
"engineers" => "Eng'rs",
"engineering" => "Eng'g",
"enterprise" => "Enter.",
"enterprises" => "Enters.",
"entertainment" => "Entm't",
"entertainments" => "Entm'ts",
"environment" => "Env't",
"environments" => "Env'ts",
"environmental" => "Envtl.",
"equality" => "Equal.",
"equipment" => "Equip.",
"equipments" => "Equips.",
"examiner" => "Exam'r",
"examiners" => "Exam'rs",
"exchange" => "Exch.",
"exchanges" => "Exchs.",
"executor" => "Ex'r",
"executrix" => "Ex'x",
"executors" => "Ex'rs",
"executrixes" => "Ex'xs",
"export" => "Exp.",
"exports" => "Exps.",
"federal" => "Fed.",
"federation" => "Fed'n",
"federations" => "Fed'ns",
"fidelity" => "Fid.",
"finance" => "Fin.",
"financial" => "Fin.",
"financing" => "Fin.",
"foundation" => "Found.",
"foundations" => "Founds.",
"general" => "Gen.",
"government" => "Gov't",
"governments" => "Gov'ts",
"guaranty" => "Guar.",
"guaranties" => "Guars.",
"hospital" => "Hosp.",
"hospitals" => "Hosps.",
"housing" => "Hous.",
"import" => "Imp.",
"imports" => "Imps.",
"importer" => "Imp.",
"importers" => "Imps.",
"importation" => "Imp.",
"importations" => "Imps.",
"incorporated" => "Inc.",
"indemnity" => "Indem.",
"indemnities" => "Indems.",
"independent" => "Indep.",
"independents" => "Indeps.",
"industry" => "Indus.",
"industries" => "Indus.",
"industrial" => "Indus.",
"information" => "Info.",
"institute" => "Inst.",
"institutes" => "Insts.",
"institution" => "Inst.",
"institutions" => "Insts.",
"insurance" => "Ins.",
"international" => "Int'l",
"investment" => "Inv.",
"investments" => "Invs.",
"laboratory" => "Lab.",
"laboratories" => "Labs.",
"liability" => "Liab.",
"liabilities" => "Liabs.",
"limited" => "Ltd.",
"limiteds" => "Ltds.",
"litigation" => "Litig.",
"litigations" => "Litigs.",
"machine" => "Mach.",
"machines" => "Machs.",
"machinery" => "Mach.",
"machineries" => "Machs.",
"maintenance" => "Maint.",
"management" => "Mgmt.",
"managements" => "Mgmts.",
"manufacturer" => "Mfr.",
"manufacturers" => "Mfrs.",
"manufacturing" => "Mfg.",
"maritime" => "Mar.",
"market" => "Mkt.",
"markets" => "Mkts.",
"marketing" => "Mktg.",
"mechanic" => "Mech.",
"mechanics" => "Mechs.",
"mechanical" => "Mech.",
"medical" => "Med.",
"medicine" => "Med.",
"memorial" => "Mem'l",
"memorials" => "Mem'ls",
"merchant" => "Merch.",
"merchandise" => "Merch.",
"merchandising" => "Merch.",
"metropolitan" => "Metro.",
"metropolitans" => "Metros.",
"municipal" => "Mun.",
"mutual" => "Mut.",
"mutuals" => "Muts.",
"national" => "Nat'l",
"nationals" => "Nat'ls",
"north" => "N.",
"northern" => "N.",
"northeast" => "Ne.",
"northeastern" => "Ne.",
"northwest" => "Nw.",
"northwestern" => "Nw.",
"number" => "No.",
"organization" => "Org.",
"organizing" => "Org.",
"organizations" => "Orgs.",
"pacific" => "Pac.",
"partnership" => "P'ship",
"partnerships" => "P'ships",
"person" => "Pers.",
"personal" => "Pers.",
"personnel" => "Pers.",
"pharmaceutics" => "Pharm.",
"pharmaceutical" => "Pharm.",
"pharmaceuticals" => "Pharms.",
"perserve" => "Pres.",
"preservation" => "Pres.",
"probation" => "Prob.",
"product" => "Prod.",
"products" => "Prods.",
"production" => "Prod.",
"productions" => "Prods.",
"professional" => "Prof'l",
"professionals" => "Prof'ls",
"property" => "Prop.",
"properties" => "Props.",
"protection" => "Prot.",
"public" => "Pub.",
"publication" => "Publ'n",
"publishing" => "Publ'g",
"publications" => "Publ'ns",
"railroad" => "R.R.",
"railway" => "Ry.",
"refining" => "Ref.",
"railways" => "Rys.",
"regional" => "Reg'l",
"rehabilitation" => "Rehab.",
"reproductive" => "Reprod.",
"reproduction" => "Reprod.",
"resource" => "Res.",
"resources" => "Res.",
"restaurant" => "Rest",
"restaurants" => "Rests.",
"retirement" => "Ret.",
"road" => "Rd.",
"roads" => "Rds.",
"saving" => "Sav.",
"savings" => "Savs.",
"school" => "Sch.",
"schools" => "Sch.",
"science" => "Sci.",
"sciences" => "Scis.",
"secretary" => "Sec'y",
"secretaries" => "Sec'ys",
"security" => "Sec.",
"securities" => "Sec.",
"service" => "Serv.",
"services" => "Servs.",
"shareholder" => "S'holder",
"shareholders" => "S'holders",
"social" => "Soc.",
"society" => "Soc'y",
"south" => "S.",
"southern" => "S.",
"southeast" => "Se.",
"southeastern" => "Se.",
"southwest" => "Sw.",
"southwestern" => "Sw.",
"steamship" => "S.S",
"steamships" => "S.S",
"street" => "St.",
"subcommittee" => "Subcomm.",
"subcommittees" => "Subcomms.",
"surety" => "Sur.",
"sureties" => "Surs.",
"system" => "Sys.",
"systems" => "Sys.",
"technology" => "Tech.",
"technologies" => "Techs.",
"telecommunication" => "Telecomm.",
"telecommunications" => "Telecomms.",
"telephone" => "Tele.",
"telegraph" => "Tele.",
"telephones" => "Teles.",
"telegraphs" => "Teles.",
"temporary" => "Temp.",
"temporaries" => "Temps.",
"township" => "Twp.",
"townships" => "Twps.",
"transcontinental" => "Transcon.",
"transport" => "Transp.",
"transportation" => "Transp.",
"transports" => "Transps.",
"transportations" => "Transps.",
"trustee" => "Tr.",
"trustees" => "Trs.",
"turnpike" => "Tpk.",
"turnpikes" => "Tpk.",
"uniform" => "Unif.",
"university" => "Univ.",
"universities" => "Univs.",
"utility" => "Util.",
"utilities" => "Utils.",
"village" => "Vill.",
"villages" => "Vills.",
"west" => "W.",
"western" => "W."
}
# These abbreviations check against the 18th edition of the Bluebook.
# No claim of ownership is made about any abbrevation, because that
# would be silly. I made some personal judgments about pluralization.
PLACES = {
'alabama' => 'Ala.',
'american aamoa' => 'Am. Sam.',
'arizona' => 'Ariz.',
'arkansas' => 'Ark.',
'baltimore' => 'Balt.',
'california' => 'Cal.',
'chicago' => 'Chi.',
'colorado' => 'Colo.',
'connecticut' => 'Conn.',
'delaware' => 'Del.',
'district of columbia' => 'D.C.',
'florida' => 'Fla.',
'georgia' => "Ga.",
'hawaii' => 'Haw.',
'hawai\'i' => 'Haw.',
'illinois' => 'Ill.',
'indiana' => 'Ind.',
'kansas' => 'Kan.',
'kentucky' => "Ky.",
'los angeles' => "L.A.",
'louisiana' => "La.",
'maine' => 'Me.',
'maryland' => 'Md.',
'massachusetts' => 'Mass.',
'michigan' => "Mich.",
'minnesota' => 'Minn.',
'mississippi' => 'Miss.',
'missouri' => 'Mo.',
'montana' => 'Mont.',
'nebraska' => 'Neb.',
'nevada' => 'Nev.',
'new hampshire' => 'N.H.',
'new jersey' => 'N.J.',
'new mexico' => 'N.M.',
'new york' => 'N.Y.',
'north carolina' => 'N.C.',
'north dakota' => 'N.D.',
'northern mariana islands' => 'N. Mar. I.',
'oklahoma' => 'Okla.',
'oregon' => 'Or.',
'pennsylvania' => 'Pa.',
'philadelphia' => 'Phila.',
'puerto rico' => 'P.R.',
'rhode island' => 'R.I.',
'south carolina' => 'S.C.',
'south dakota' => 'S.D.',
'san francisco' => 'S.F.',
'tennessee' => 'Tenn.',
'texas' => 'Tex.',
'vermont' => 'Vt.',
'virgin islands' => 'V.I.',
'virginia' => 'Va.',
'washington' => 'Wash.',
'west virginia' => 'W. Va.',
'wisconsin' => 'Wis.',
'wyoming' => 'Wyo.'
}
###########################################################
# What follows is the substitution program.
#
# It takes the selected text, splits it into words,
# checks to see if the word appears in the table above
# (without regard to capitalization), and if so does
# the substitution. Then it reassembles the text
# with spaces.
#
# I have added some logic to understand punctuation.
# It can understand opening or closing parentheses that
# touch a word, and it can also understand a trailing comma
# or semicolon. Any other punctuation will cause the word
# not to be a match.
# KNOWN ISSUE: This does not yet know how to process
# terms that might be split into two words, such as "rail road"
# or "south east." I may need some guidance about whether
# those present citation edge cases.
# KNOWN ISSUE: This produces 'dumb' apostrophes, which require
# some tweaking in your word processor.
# List of valid punctuation marks, by ASCII codes
LEADING_PUNCTUATION = [40]
TRAILING_PUNCTUATION = [41, 44, 59]
casename = STDIN.read
casename.strip!
tmp = Array.new
# break apart the cite into words
casename.split(/\s/).each do |word|
# reset things for each word
leading_punctuation = []
trailing_punctuation = []
reassembled = ""
# See if there is a leading parenthesis; if so, set it aside
if LEADING_PUNCTUATION.include?(word.slice(0)) and (word.size > 1)
leading_punctuation << word.slice!(0)
end
# See if there is a trailing comma, semicolon, or closing parenthesis
while TRAILING_PUNCTUATION.include?(word.slice(-1))
trailing_punctuation << word.slice!(-1)
end
# Look at the word itself. See if there is a match in one of the
# lists above. If so, substitute as directed.
if WORDS.has_key?(word.downcase)
reassembled = WORDS[word.downcase].gsub("'","\x27")
elsif PLACES.has_key?(word.downcase)
reassembled = PLACES[word.downcase].capitalize
else
reassembled = word
end
# Now recombine with any punctuation marks that were set aside.
# ... start with any leading punctuation
if (leading_punctuation.size == 1)
reassembled = leading_punctuation.first.chr + reassembled
end
# ...then add back the trailing punctuation
if trailing_punctuation.size > 0
trailing_punctuation.each do |l|
reassembled += l.chr
end
end
# now take the abbreviated word and add it back to the list
tmp << reassembled
end
# recombine all the component words back into the case name
# and then replace the selected text in the document
puts tmp.join(" ")
GitHub Events
Total
- Watch event: 1
Last Year
- Watch event: 1