Skip to content
Open
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
36 changes: 36 additions & 0 deletions projects/m4/007-weird-words/js/example01.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
London[c] is the capital and largest city[d] of both England and the United Kingdom, with a population of 8,866,180 in 2022.[2] The wider metropolitan area is the largest in Western Europe, with a population of 14.9 million.[7] London stands on the River Thames in southeast England, at the head of a 50-mile (80 km) estuary down to the North Sea, and has been a major settlement for nearly 2,000 years.[8] Its ancient core and financial centre, the City of London, was founded by the Romans as Londinium and has retained its medieval boundaries.[e][9] The City of Westminster, to the west of the City of London, has been the centuries-long host of the national government and parliament. London grew rapidly in the 19th century, becoming the world's largest city at the time. Since the 19th century,[10][11] the name "London" has referred to the metropolis around the City of London, historically split between the counties of Middlesex, Essex, Surrey, Kent, and Hertfordshire,[12] which since 1965 has largely comprised the administrative area of Greater London, governed by 33 local authorities and the Greater London Authority.[f][13]

As one of the world's major global cities,[14][15] London exerts a strong influence on world art, entertainment, fashion, commerce, finance, education, healthcare, media, science, technology, tourism, transport, and communications.[16][17] Despite a post-Brexit exodus of stock listings from the London Stock Exchange,[18][19] London remains Europe's most economically powerful city[20] and one of the world's major financial centres. It hosts Europe's largest concentration of higher education institutions,[21] some of which are the highest-ranked academic institutions in the world: Imperial College London in natural and applied sciences, the London School of Economics in social sciences, and the comprehensive University College London.[22][23] It is the most visited city in Europe and has the world's busiest city airport system.[24] The London Underground is the world's oldest rapid transit system.[25]

London's diverse cultures encompass over 300 languages.[26] The 2023 population of Greater London of just under 10 million[27] made it Europe's third-most populous city,[28] accounting for 13.4% of the United Kingdom's population[29] and over 16% of England's population. The Greater London Built-up Area is the fourth-most populous in Europe, with about 9.8 million inhabitants as of 2011.[30][3] The London metropolitan area is the third-most populous in Europe, with about 14 million inhabitants as of 2016, making London a megacity.[g][31][32]

Four World Heritage Sites are located in London: Kew Gardens; the Tower of London; the site featuring the Palace of Westminster, Church of St. Margaret, and Westminster Abbey; and the historic settlement in Greenwich where the Royal Observatory defines the prime meridian (0° longitude) and Greenwich Mean Time.[33] Other landmarks include Buckingham Palace, the London Eye, Piccadilly Circus, St Paul's Cathedral, Tower Bridge, and Trafalgar Square. The city has the most museums, art galleries, libraries, and cultural venues in the UK, including the British Museum, National Gallery, Natural History Museum, Tate Modern, British Library, and numerous West End theatres.[34] Important sporting events held in London include the FA Cup Final, the Wimbledon Tennis Championships, and the London Marathon. It became the first city to host three Summer Olympic Games upon hosting the 2012 Summer Olympics.[35]

Toponymy
Main article: Etymology of London
London is an ancient name, attested in the first century AD, usually in the Latinised form Londinium.[36] Modern scientific analyses of the name must account for the origins of the different forms found in early sources: Latin (usually Londinium), Old English (usually Lunden), and Welsh (usually Llundein), with reference to the known developments over time of sounds in those different languages. It is agreed that the name came into these languages from Common Brythonic; recent work tends to reconstruct the lost Celtic form of the name as *Londonjon or something similar. This was then adapted into Latin as Londinium and borrowed into Old English.[37]

Until 1889, the name "London" applied officially only to the City of London, but since then it has also referred to the County of London and to Greater London.[38]

History
Main article: History of London
For a chronological guide, see Timeline of London.
Prehistory
In 1993, remains of a Bronze Age bridge were found on the south River Thames foreshore, upstream from Vauxhall Bridge.[39] Two of the timbers were radiocarbon dated to 1750–1285 BC.[39] In 2010, foundations of a large timber structure, dated to 4800–4500 BC,[40] were found on the Thames's south foreshore downstream from Vauxhall Bridge.[41] Both structures are on the south bank of the Thames, where the now-underground River Effra flows into the Thames.[41]

Roman London
Main article: Londinium

Reconstruction drawing of Londinium in 120 AD

A surviving section of the 3rd-century London Wall behind Tower Hill
Despite the evidence of scattered Brythonic settlements in the area, the first major settlement was founded by the Romans around 47 AD,[1] about four years after their invasion of 43 AD.[42] This only lasted until about 61 AD, when the Iceni tribe led by Queen Boudica stormed it and burnt it to the ground.[43]

The next planned incarnation of Londinium prospered, superseding Colchester as the principal city of the Roman province of Britannia in 100. At its height in the 2nd century, Roman London had a population of about 60,000.[44]

Anglo-Saxon and Viking-period London
With the early 5th-century collapse of Roman rule, the walled city of Londinium was effectively abandoned, although Roman civilisation continued around St Martin-in-the-Fields until about 450.[45] From about 500, an Anglo-Saxon settlement known as Lundenwic developed slightly west of the old Roman city.[46] By about 680 the city had become a major port again, but there is little evidence of large-scale production. From the 820s repeated Viking assaults brought decline. Three are recorded; those in 851 and 886 succeeded, while the last, in 994, was rebuffed.[47]

The Vikings applied Danelaw over much of eastern and northern England, its boundary running roughly from London to Chester as an area of political and geographical control imposed by the Viking incursions formally agreed by the Danish warlord, Guthrum and the West Saxon king Alfred the Great in 886. The Anglo-Saxon Chronicle records that Alfred "refounded" London in 886. Archaeological research shows this involved abandonment of Lundenwic and a revival of life and trade within the old Roman walls. London then grew slowly until a dramatic increase in about 950.[48]

By the 11th century, London was clearly the largest town in England. Westminster Abbey, rebuilt in Romanesque style by King Edward the Confessor, was one of the grandest churches in Europe. Winchester had been the capital of Anglo-Saxon England, but from this time London became the main forum for foreign traders and the base for defence in time of war. In the view of Frank Stenton: "It had the resources, and it was rapidly developing the dignity and the political self-consciousness appropriate to a national capital."
30 changes: 30 additions & 0 deletions projects/m4/007-weird-words/js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const { readFile } = require('fs/promises');

const filePath = './example01.txt';

readFile(filePath)
.then((data) => {
// Transformed the string into an array first and then into a set to eliminate duplicates
const wordsTextFile = new Set(data.toString().split(' '));

// Converting the set back to an array that now contains no duplicates
const wordsText = [...wordsTextFile];

// Searching for words with the diphthongs ie and ei and concatenating them into a single array
const wordsWithEi = wordsText.filter((word) => word.includes('ei'));
const wordsWithIe = wordsText.filter((word) => word.includes('ie'));

const weirdWords = wordsWithEi.concat(wordsWithIe);

// Arrays with words without diphthongs ie and ei
const normalWords = wordsText.filter(
(word) => !word.includes('ie') && !word.includes('ei')
);

console.log(
`The text contains a total of ${weirdWords.length} words with diphthongs 'ie' and 'ie'. Text contains a total of ${normalWords.length} words without the diphthongs 'ie' and 'ie'`
);
})
.catch((error) => {
console.log('The program is unable to open the file you indicated');
});