Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# file types
.Rhistory
# generated data (phoible.csv is committed zipped, as phoible.csv.zip)
data/phoible.csv
# pixi environments
.pixi/*
!.pixi/config.toml
2 changes: 1 addition & 1 deletion data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ various parts of the project:
[CLDF StructureDataset](https://phoible.org/download).

- This repository is https://github.com/phoible/dev. Data in machine-readable
form (`csv` and `RData`) is available here. It contains the cleaned and
form (`csv`, zipped as `phoible.csv.zip`, and `RData`) is available here. It contains the cleaned and
aggregated data. It is not guaranteed to exactly match what
is published at PHOIBLE Online, due to the occasional discovery and
correction of errors and the addition of new languages. For this reason,
Expand Down
105,485 changes: 0 additions & 105,485 deletions data/phoible.csv

This file was deleted.

Binary file added data/phoible.csv.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion mappings/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mappings

This folder contains files that map InventoryID to metadata not stored directly in [phoible.csv](../data/phoible.csv).
This folder contains files that map InventoryID to metadata not stored directly in [phoible.csv.zip](../data/phoible.csv.zip).

- [InventoryID-LanguageCodes.csv](InventoryID-LanguageCodes.csv): InventoryID, Glottocode, ISO6393, LanguageName, SpecificDialect. One row per InventoryID.
- [InventoryID-Bibtex.csv](InventoryID-Bibtex.csv): InventoryID, BibtexKey. An InventoryID can have several citations, so this is one to many.
Expand Down
2 changes: 2 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ r = "4.*"
[feature.agg.dependencies]
r-zoo = ">=1.8_15,<2"
r-stringi = ">=1.8.7,<2"
r-zip = ">=2.3.0,<3"

[feature.agg.tasks]
aggregate = { cmd = "Rscript aggregate-raw-data.R", cwd = "scripts" }
add_features = { cmd = "Rscript add-features.R", cwd = "scripts" }
zip_phoible = { cmd = "Rscript zip-phoible.R", cwd = "scripts", depends-on = ["add_features"] }

[feature.ci.dependencies]
r-dplyr = "1.1.1.*"
Expand Down
2 changes: 1 addition & 1 deletion raw-data/PH/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PH

The `PH` folder contains phonological inventory data (phonemes, allophones, and tones) drawn from journal articles, theses, and published grammars. Collectively, they represent a convenience sample of languages and they were selected to improve worldwide coverage of the aggregated phoible data. Their source is tagged `ph` in the aggregated [phoible.csv](../../data/phoible.csv) file.
The `PH` folder contains phonological inventory data (phonemes, allophones, and tones) drawn from journal articles, theses, and published grammars. Collectively, they represent a convenience sample of languages and they were selected to improve worldwide coverage of the aggregated phoible data. Their source is tagged `ph` in the aggregated [phoible.csv.zip](../../data/phoible.csv.zip) file.

The inventory data in [phoible_inventories.tsv](phoible_inventories.tsv) were added by members of the Linguistic Phonetics Laboratory at the University of Washington. The contents are described in:

Expand Down
2 changes: 1 addition & 1 deletion raw-data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This folder contains the raw-data for the different sources in phoible. See the README file in each folder for more information about the source and its contents.

The raw data is provided largely as received from the original source, with some modifications to make it easier to process. The raw data is not meant to be used directly, but rather to be processed by the scripts in the `scripts` folder to produce the aggregated data in the `data` folder. The aggregated data is what is used to produce the phoible.csv file in the `data` folder, which is the main data file for phoible.
The raw data is provided largely as received from the original source, with some modifications to make it easier to process. The raw data is not meant to be used directly, but rather to be processed by the scripts in the `scripts` folder to produce the aggregated data in the `data` folder. The aggregated data is what is used to produce the phoible.csv.zip file in the `data` folder, which is the main data file for phoible.

If you use the raw data, please cite the original source of the data, as well as phoible.
See the README.md file in each folder for more information about how to cite the original source of the data.
Expand Down
2 changes: 1 addition & 1 deletion scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# PHOIBLE scripts

To transform the raw data sources into aggregated PHOIBLE CSV and Rdata data files, run `Rscript aggregate-raw-data.R` (from a terminal) or `source('aggregate-raw-data.R')` from within R. Then to generate and append phonological features to the PHOIBLE CSV and Rdata files, run `Rscript add-features.R` (terminal) or `source('add-features.R')` (within R).
To transform the raw data sources into aggregated PHOIBLE CSV and Rdata data files, run `Rscript aggregate-raw-data.R` (from a terminal) or `source('aggregate-raw-data.R')` from within R. Then to generate and append phonological features to the PHOIBLE CSV and Rdata files, run `Rscript add-features.R` (terminal) or `source('add-features.R')` (within R). Then to compress the resulting CSV into `phoible.csv.zip` (the version tracked in git), run `Rscript zip-phoible.R` (terminal) or `source('zip-phoible.R')` (within R).
10 changes: 10 additions & 0 deletions scripts/zip-phoible.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /usr/bin/env Rscript

## Compresses data/phoible.csv into data/phoible.csv.zip.
## Run after add-features.R has (re)written phoible.csv.

csv_path <- file.path("..", "data", "phoible.csv")
zip_path <- file.path("..", "data", "phoible.csv.zip")

zip::zip(zip_path, basename(csv_path), root=dirname(csv_path))
cat("wrote", zip_path, "\n")
2 changes: 1 addition & 1 deletion tests/test-cross-inventory-integrity.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ library(dplyr, warn.conflicts=FALSE)
library(testthat, warn.conflicts=FALSE)

## load PHOIBLE data
phoible_data_file <- file.path("..", "data", "phoible.csv")
phoible_data_file <- file.path("..", "data", "phoible.csv.zip")
phoible_col_types <- readr::cols(InventoryID="c", Marginal="l", .default="c")
phoible <- readr::read_csv(phoible_data_file, col_types=phoible_col_types)

Expand Down
2 changes: 1 addition & 1 deletion tests/test-inventory-metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ library(testthat, warn.conflicts=FALSE)
context("Inventory metadata")

## load PHOIBLE data
phoible_data_file <- file.path("..", "data", "phoible.csv")
phoible_data_file <- file.path("..", "data", "phoible.csv.zip")
phoible_col_types <- readr::cols(InventoryID="c", Marginal="l", .default="c")
phoible <- readr::read_csv(phoible_data_file, col_types=phoible_col_types)

Expand Down
2 changes: 1 addition & 1 deletion tests/test-phonemes.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ library(dplyr, warn.conflicts=FALSE)
library(testthat)

## load PHOIBLE data
phoible_data_file <- file.path("..", "data", "phoible.csv")
phoible_data_file <- file.path("..", "data", "phoible.csv.zip")
phoible_col_types <- readr::cols(InventoryID="c", Marginal="l", .default="c")
phoible <- readr::read_csv(phoible_data_file, col_types=phoible_col_types)

Expand Down