Building a Contemporary Setswana Corpus from the Web

Contemporary Setswana appears in digital news, school notices, public information, radio transcripts, and messages shared across social platforms. These materials record current vocabulary, changing expressions, English code-switching, and the difference between formal and informal registers. Older dictionaries remain essential, but only a dated collection of real texts can show which constructions are common today, how they cluster, and which senses dominate in particular settings.

For a lexicographer and corpus linguist, using web scraping to build a contemporary Setswana corpus converts those texts into research data. A web crawler retrieves pages systematically, while a corpus workflow preserves provenance, filters irrelevant material, and prepares language samples for analysis. The method must be technically careful and ethically defensible: public visibility is not blanket permission, and numerical abundance cannot guarantee cultural balance. The collection protocol therefore matters as much as the software.

Why a contemporary corpus is needed

A living corpus remedies the age gap in printed reference works. It can capture revived words, new compounds, and usages that dictionaries have not yet documented. Searches across a broad collection can test whether a proposed meaning is limited to one report or appears across genres, while dated examples give editors evidence they can cite.

It also preserves variation instead of presenting one supposedly uniform language. Setswana in a government service may differ from Setswana in popular reporting, classroom writing, or informal discussion. Standard spellings coexist with community and publisher practices. Making those patterns visible allows lexicographers to separate productive variation from isolated errors and to decide when a usage note is justified.

Searchable evidence also supports translation. Context-rich examples reveal whether a term is institutionally fixed, emotionally charged, or situation-dependent. Counts cannot settle meaning by themselves, but they direct attention to likely senses and reveal gaps requiring expert interpretation. A useful corpus therefore joins authentic texts with editorial judgement: data narrows the search, while knowledge of Setswana culture determines what the evidence means.

Choosing sources and setting crawl boundaries

Source selection should come before crawling. Candidates include Setswana-language publishers, public agencies, schools, universities, broadcasters, cultural organisations, community outlets, and news sites. Each represents a genre, so sources should be balanced by type rather than volume. An allow-list or carefully chosen seed list reduces irrelevant material and makes the initial crawl auditable.

Crawl rules need to be recorded: host restrictions, depth limits, permitted file types, date boundaries, and request frequency. Links often lead from an article to menus, search results, archives, or syndicated copies. Filters must distinguish editorial text from navigation while avoiding the removal of meaningful differences between copies. Retrieval times, titles, source types, and content hashes should accompany every document.

Australian digital libraries show why scope and metadata matter. Trove, operated by the National Library of Australia, preserves selected parts of Australia’s web history, offering a model for durable provenance even when a corpus concerns an African language. The same care can be applied to Setswana sites hosted in Botswana, South Africa, and elsewhere. A corpus design consultation can turn broad ambitions into a source list, exclusion rules, and schedule.

Building a responsible and lawful crawler

Responsible harvesting begins with a site’s own signals. The crawler should read robots.txt, check terms governing automated access, avoid high-load paths, and document exceptions. Public pages can still be covered by copyright or contract. Australia’s Copyright Act 1968 includes limited research and text-and-data-mining exceptions, but these are not blanket permission for indiscriminate copying; redistribution or commercial use may require further advice.

Privacy needs a separate assessment. Names, contact details, comments, and user identifiers should not enter a linguistic corpus merely because a page is public. The Privacy Act 1988 and Australian Privacy Principles may require organisations to consider collection, use, security, and disclosure. Corpus builders usually need little personal information, so removing such data reduces legal risk while improving linguistic relevance.

The Spam Act 2003 regulates sending commercial electronic messages, not ordinary collection of public pages, although later email outreach must comply with it. Ethical practice extends further. Setswana communities should have a voice in sensitive cultural material, and the crawl log should explain why domains were excluded as well as what was collected. These records allow community expectations to shape later revisions.

Preserving and preparing the collected text

Extraction should distinguish what a page said from what software inferred. A crawler can preserve raw HTML or a web archive file, then derive plain text by removing menus, adverts, scripts, and repeated headers. The original remains the evidence; the derivative supports analysis. URLs, dates, titles, language decisions, and transformation steps should travel with the text so that cleaning can be audited.

Two acquisition designs make different trade-offs:

Design choice Broad general crawl Setswana-focused crawl Corpus consequence
Scope Many domains and languages Curated language-relevant domains Higher signal and fewer genre imbalances
Discovery Open link expansion Allow-listed seeds and vetted links Greater control and reproducibility
Language handling Keep all detected languages Keep verified Setswana and tagged code-switching More accurate token counts and comparisons
Preservation Save current HTML snapshots Retain raw files, text, metadata, checksums Auditable and reproducible processing
Updates Frequent broad refreshes Scheduled incremental updates Lower server load and visible change over time

Language identification needs special care because automatic classifiers may confuse Setswana with related Southern African languages or short English passages. A mixed-language page remains useful if the pipeline records each passage’s proportion and location. Code-switched tokens should not be silently removed, since their frequency and function reveal contemporary multilingual behaviour.

Tokenisation should follow the research question. Abbreviations, dates, hyphenated forms, and clause boundaries can all affect counts. Researchers might preserve source spelling for analysis while building a normalised index for frequency searches. Two linked representations—source-faithful text and an analysed layer—prevent convenient normalisation from erasing evidence about spelling variation or regional practice.

Measuring coverage and representativeness

Coverage belongs in the corpus report. Counts of documents, tokens, dates, genres, languages, host domains, duplicate rates, and exclusions expose imbalances. If one syndicated publisher supplies most documents, frequency may reflect its editorial style rather than Setswana generally. Reporting the collection process is therefore more informative than a vague claim of comprehensiveness.

Australian habits offer a useful comparison. People in Sydney and Melbourne commonly read news through mobile apps during train journeys, share links through messaging services, and encounter library campaigns by email or social media. A corpus limited to institutional home pages would miss those contexts. Mobile pages, community outlets, and independently produced material broaden the sample of how language circulates.

Representativeness also involves geography and audience. Setswana communities span Botswana, South Africa, and diasporas, whose online presence differs in language mix, connectivity, and publishing power. Australian universities, libraries, publishers, and translators can support collection and reuse, but should not dictate which African language questions are studied. Selection criteria must remain tied to the research aims and the communities represented.

Applying corpus evidence to lexicography and translation

Corpus evidence becomes useful through workflows connecting counts to interpretation. Concordance lines can test a candidate sense, collocations can refine definitions, and genre comparisons can support labels such as formal, educational, or popular. Missing evidence in a limited corpus proves little, so every proposed entry should link to dated examples an editor can verify.

Translation presents a related challenge because simplicity can erase cultural specificity. The approach described in balancing simplicity and culture shows why clear language need not mean culturally thin language. A corpus can reveal the ordinary words children meet in stories and where technical expressions require explanation, helping translators choose accessible forms without flattening meaning.

Possible outputs include frequency dictionaries, searchable concordances, specialised word lists, and evidence briefs for lexicographers. Each should distinguish observed usage from editorial recommendations and state the limits of the sample. Where spelling or meaning varies, parallel citations can show the range rather than impose an unsupported preference. This transparency makes the resource dependable for dictionary makers, translators, teachers, and communities.

Maintaining a durable language resource

A contemporary corpus is a versioned research asset, not a one-off download. Raw captures, processing scripts, documentation, and rights records should be stored separately, with checksums linking each derived dataset to its source. A revised collection needs a new identifier and release note. Preserving that history allows researchers to reproduce counts when pages change or disappear.

Access can be tiered: public text and metadata may support teaching and reuse, while archived copies or identifiable material may require controls. An Australian host should publish a retention policy, takedown route, and named contact, while researchers follow licence terms and cite the exact release. Maintenance also depends on scripts that can run again without relying on one researcher’s computer.

The first release should be modest enough to audit but complete enough to test the method. The immediate next step is a one-page corpus specification naming the date range, target domains, inclusion criteria, crawl limits, metadata fields, review responsibilities, and retention period.