Learn R Programming

sumer (version 1.0.0)

save_dictionary: Save a Sumerian Dictionary to File

Description

Saves a Sumerian dictionary data frame to a semicolon-separated text file with a metadata header containing author, year, version, and URL information.

Usage

save_dictionary(dic, file, author = "", year = "", version = "", url = "")

Value

No return value. The function is called for its side effect of writing the dictionary to a file.

Arguments

dic

A dictionary data frame, typically created by make_dictionary or convert_to_dictionary. Must contain columns sign_name, row_type, count, type, and meaning.

file

A character string specifying the output file path.

author

A character string with the author name(s) for the metadata header.

year

A character string with the year of creation for the metadata header.

version

A character string with the version number for the metadata header.

url

A character string with a URL where updates can be found.

Details

Output Format

The output file consists of two parts:

  1. A metadata header with lines starting with ###, containing author, year, version, and URL information

  2. The dictionary data in semicolon-separated format with columns: sign_name, row_type, count, type, meaning

Example output:


###---------------------------------------------------------------
###                Sumerian Dictionary
###
### Author:  Robin Wellmann
### Year:    2026
### Version: 1.0
### Watch for Updates: https://founder-hypothesis.com/sumer/
###---------------------------------------------------------------
sign_name;row_type;count;type;meaning
A;cunei.;;;<cuneiform sign for A>
A;reading;;;{a, dur5, duru5}
A;trans.;3;S;water

See Also

make_dictionary and convert_to_dictionary for creating dictionaries, read_dictionary for reading saved dictionaries.

Examples

Run this code
# \donttest{
# Create and save a dictionary

filename  <- system.file("extdata", "text_with_translations.txt", package = "sumer")
dictionary <- make_dictionary(filename)

save_dictionary(
  dic     = dictionary,
  file    = "sumerian_dictionary.txt",
  author  = "John Doe",
  year    = "2024",
  version = "1.0",
  url     = "https://example.com/dictionary"
)
# }

Run the code above in your browser using DataLab