Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dolsysmith committed Sep 24, 2024
2 parents 9c77c7a + 565be41 commit 585ff95
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/text-as-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</head>
<body>
<h1>Text vs. Tokens</h1>
<h2>The following text has been tokenized, and the tokens are presented in alphabetical order (exclusing punctuation). What would you say that the text is <i>about</i>?</h2>
<h2>The following text has been tokenized, and the tokens are presented in alphabetical order (excluding punctuation). What would you say that the text is <i>about</i>?</h2>
<div id="tokens"></div>
<h2>Now review the original text. How close was your original guess?</h2>
<div id="text">
Expand Down
5 changes: 5 additions & 0 deletions docs/text_swap.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ h2 {
text-align: justify;
font-family: sans-serif;
}

.citation {
font-size: .75em;
font-family: serif;
}
6 changes: 6 additions & 0 deletions docs/text_swap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ TOKENIZED_TEXT = `
African African African An Business CCDL Center Cissé Cissé Cyber Diplomacy GW GWSB GWSB GWSB Leadership Pape School a about academic adjunct advances against aiming aims also ambassadors an and and and and and and and and and announced as between cofounder community conferences connects cyber cyberattacks cybersecurity cybersecurity cybersecurity defend diplomacy during education enhance for government heads help help include information last leaders leaders leaders members ministers month of of of of of officials opportunity organization partnership partnership partnership policy policymaking practices prepare problems professor providing rapidly real said said seminars shape solve state students technology technology that the the the the the the the to to to to understanding while will with with world year
`

SOURCE = `Gross, Sarah. "Business School partners with cybersecurity organization to inform students, African leaders." <i>The GW Hatchet</i>, September 9, 2024. https://gwhatchet.com/2024/09/09/business-school-partners-with-cybersecurity-organization-to-inform-students-african-leaders/`

function createP(text, div) {
let p = document.createElement('p');
p.innerHTML = text;
Expand All @@ -18,6 +20,10 @@ function addText(e) {
textDiv.innerHTML = "";
TEXT.split('\n\n').forEach(paragraph => createP(paragraph, textDiv));
textDiv.removeEventListener("click", addText);
let citation = document.createElement("p");
citation.classList.add('citation');
citation.innerHTML = SOURCE;
textDiv.append(citation);
}

function textDisplay() {
Expand Down
Binary file not shown.

0 comments on commit 585ff95

Please sign in to comment.