oxford-text-checker
Version:
OxfordTextChecker wrapper - analyzes vocabulary in your text
310 lines • 14.2 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createExercisechkboxes = exports.wordListCategories = exports.activityFilterCheckBoxes = exports.activityText = exports.barChartData = exports.resultTable = exports.dougnutData = exports.dougnutOptions = exports.wordLevel = exports.dictionaryType = exports.cefrButtons = exports.dropDownlOptions = exports.resultData = exports.startpageText = void 0;
exports.startpageText = {
textCheckreDef: 'Use the <b>Oxford Text Checker</b> to find out which words in any English text are included in our word lists.',
textCheckreDef_1: 'See a detailed analysis of the vocabulary in your text.',
textCheckreDef_2: 'Use your text to create a word list or an exercise.',
textCheckreDef_3: 'Find out more about our word lists >',
text_checkbox_1: 'Upper-/Lower-case letters must match',
text_checkbox_2: 'Ignore number expressed in digits',
text_advance: 'Write any words to be ignored in the box (type words on a single line, separated by a space. For example: <i>London Oxford Maria</i>):',
};
exports.resultData = {
blocks: {
ox3k: ['a1', 'a2', 'b1', 'b2'],
ox5k_only: ['b2', 'c1'],
},
helpText: [
{
name: 'Text',
text: 'When you check a piece of text using the <i>Oxford Text Checker</i>, you will see your text in the <b>Text</b> tab, with each Oxford 5000 word coloured according to its CEFR level. Use the dropdown menu at the top of this page to check your text against our other word lists.<br/><br/>You can change which CEFR levels are highlighted in your text by clicking/tapping on the <b>CEFR level</b> buttons above the text.<br/><br/>The underlined words in your text have other parts of speech with different CEFR levels. If you hover over/soft tap any of the coloured words, you can see the CEFR level for that word and for any other parts of speech.',
},
{
name: 'Results',
text: 'Go to the <b>Results</b> tab to see a detailed analysis of your text. Use the dropdown menu at the top of this page to see the results for our other word lists.<br/><br/>To show or hide a more detailed breakdown of your text, click/tap on <b>More detail</b>.',
},
{
name: 'Activities',
text: 'In the <b>Activities</b> tab, you can use your text to create a word list or an exercise. Detailed instructions on how to do this are given in the Help section at the top of the page.',
},
],
};
exports.dropDownlOptions = [
{ val: 'ox3k', label: 'Oxford 3000' },
{ val: 'ox5k', label: 'Oxford 5000' },
{ val: 'ox5k_only', label: 'Oxford 5000 excluding Oxford 3000' },
{ val: 'opal', label: 'OPAL written words' },
];
exports.cefrButtons = [
{
name: 'A1',
hide: false,
color: '#0069b4',
active: true,
disabled: true,
},
{
name: 'A2',
hide: false,
color: '#c91352',
active: true,
disabled: true,
},
{
name: 'B1',
hide: false,
color: '#b95b0b',
active: true,
disabled: true,
},
{
name: 'B2',
hide: false,
color: '#1a873b',
active: true,
disabled: true,
},
{
name: 'C1',
hide: false,
color: '#964db0',
active: true,
disabled: true,
},
];
exports.dictionaryType = {
ox5k: {
wordType: 'ox5k',
show: [0, 1, 2, 3, 4],
},
ox3k: {
wordType: 'ox3k',
show: [0, 1, 2, 3],
},
ox5k_only: {
wordType: 'ox5k_only',
show: [3, 4],
},
opal: {
wordType: 'opal',
show: [],
},
};
exports.wordLevel = {
a1: { color: '#0069b4' },
a2: { color: '#c91352' },
b1: { color: '#b95b0b' },
b2: { color: '#1a873b' },
c1: { color: '#964db0' },
b1_ul: { color: '#b95b0b' },
b2_ul: { color: '#1a873b' },
a2_ul: { color: '#c91352' },
a1_ul: { color: '#0069b4' },
opal: { color: '#1e73b7' },
};
exports.dougnutOptions = {
legend: {
display: false,
},
tooltips: {
callbacks: {
label: function (tooltipItem, data) {
return data['labels'][tooltipItem['index']];
},
afterBody: function (tooltipItem, data) {
var dataset = data['datasets'][0], nTotal = data.totalWords;
var percent = Math.round((dataset['data'][tooltipItem[0]['index']] / nTotal) * 100);
percent = percent + '%';
var wordStr = dataset['data'][tooltipItem[0]['index']] === 1 ? ' word ' : ' words ';
var multistringText = [dataset['data'][tooltipItem[0]['index']] + wordStr + '(' + percent + ')'];
return multistringText;
},
/* afterLabel: (tooltipItem, data) => {
var dataset = data['datasets'][0],nTotal = data.totalWords;
var percent = Math.round((dataset['data'][tooltipItem['index']] / nTotal) * 100)
return percent + '%';
} */
},
backgroundColor: 'rgba(255,255,255,0.8)',
titleFontSize: 16,
titleFontColor: '#0066ff',
bodyFontColor: '#000',
bodyFontSize: 16,
fontFamily: 'SourceSansProRegular',
textAlign: 'center',
borderColor: 'rgba(0,0,0,0.2)',
borderWidth: 2,
bodySpacing: 6,
},
cutoutPercentage: 60,
responsive: true,
maintainAspectRatio: true,
};
exports.dougnutData = {
doughList: {
ox3k: [
{ name: 'a1', label: 'A1', bg: '#0069b4' },
{ name: 'a2', label: 'A2', bg: '#c91352' },
{ name: 'b1', label: 'B1', bg: '#b95b0b' },
{ name: 'b2', label: 'B2', bg: '#1a873b' },
{ name: 'uncl', label: 'Unclassified', bg: '#585d65' },
],
ox5k: [
{ name: 'a1', label: 'A1', bg: '#0069b4' },
{ name: 'a2', label: 'A2', bg: '#c91352' },
{ name: 'b1', label: 'B1', bg: '#b95b0b' },
{ name: 'b2', label: 'B2', bg: '#1a873b' },
{ name: 'c1', label: 'C1', bg: '#964db0' },
{ name: 'uncl', label: 'Unclassified', bg: '#585d65' },
],
ox5k_only: [
{ name: 'b2', label: 'B2', bg: '#1a873b' },
{ name: 'c1', label: 'C1', bg: '#964db0' },
{ name: 'uncl', label: 'Unclassified', bg: '#585d65' },
],
opal: [
{ name: 'opal', label: 'OPAL written', bg: '#1e73b7' },
{ name: 'uncl', label: 'Unclassified', bg: '#585d65' },
],
},
labels: ['A1', 'A2', 'B1', 'B2', 'C1', 'Unclassified'],
backgroundColor: ['#0069b4', '#c91352', '#b95b0b', '#1a873b', '#964db0', '#585d65'],
};
exports.resultTable = {
CefrCols: ['CEFR level', 'Number of words', '% of total'],
categoryCols: ['Category', 'Number of words', '% of total'],
catbg: ['#be097f', '#25919d', '#966048', '#1e73b7', '#585d65'],
};
exports.barChartData = {
labels: ['3000', '5000', '5000 not 3000', 'OPAL', 'Unclassified'],
backgroundColor: ['#be097f', '#25919d', '#966048', '#1e73b7', '#585d65'],
options: {
legend: {
display: false,
},
tooltips: {
backgroundColor: 'rgba(255,255,255,0.9)',
titleFontSize: 16,
titleFontColor: '#0066ff',
bodyFontColor: '#000',
bodyFontSize: 14,
callbacks: {
title: function () { },
label: function (tooltipItem, data) {
var toolTipLbl = [
'Oxford 3000',
'Oxford 5000',
'Oxford 5000 excluding Oxford 3000',
'OPAL written words',
'Unclassified',
];
return toolTipLbl[tooltipItem['index']];
},
afterBody: function (tooltipItem, data) {
// var dataset = data['datasets'][0], nTotal = data['datasets'][0].totalWords;
// var noOfword = Math.round((dataset['data'][tooltipItem[0]['index']] / 100) * nTotal);
// let wordStr = (noOfword === 1) ? ' word ' : ' words ';
// var multistringText = [noOfword + wordStr + '(' + Math.round(data['datasets'][0]['data'][tooltipItem[0]['index']]) + '%' + ')'];
var dataset = data['datasets'][0], aWordsCount = dataset.wordscount, nIndex = tooltipItem[0].index, noOfword = aWordsCount[nIndex], wordStr = noOfword === 1 ? ' word ' : ' words ', multistringText = [noOfword + wordStr + '(' + Math.round(data['datasets'][0]['data'][nIndex]) + '%' + ')'];
return multistringText;
},
},
borderColor: 'rgba(0,0,0,0.2)',
borderWidth: 2,
},
scales: {
xAxes: [
{
gridLines: {
color: '#9d9d9d',
borderDash: [1, 1],
},
ticks: {
autoSkip: false,
fontSize: 16,
precision: 2,
suggestedMin: 0,
// maxRotation:document.getElementsByClassName('OUP_TEXT_CHECKER_WRAPPER')[0].clientWidth > 380 ? 0 : undefined,
// minRotation:document.getElementsByClassName('OUP_TEXT_CHECKER_WRAPPER')[0].clientWidth > 380 ? 0 : undefined,
/* callback: function(value, index, values) {
// return '$' + value;
console.log(value.split(' '));
return value.split(' ')[0] + '<br/> test';
} */
},
scaleLabel: {
display: false,
labelString: 'Word list category',
fontColor: '#000',
fontFamily: 'SourceSansProRegular',
fontSize: 16,
},
},
],
yAxes: [
{
gridLines: {
color: 'rgba(0, 0, 0, 0)',
zeroLineBorderDash: [1, 1],
},
ticks: {
beginAtZero: true,
fontSize: 14,
max: 100,
stepSize: 50,
},
scaleLabel: {
display: true,
disableRotation: true,
labelString: '%',
fontColor: '#000',
fontFamily: 'SourceSansProRegular',
fontSize: 17,
},
},
],
},
},
};
exports.activityText = {
heading: 'Help',
instructions: [
'Use <b>Filters</b> to choose which category/categories you would like to include in your word list or exercise.',
'Click/Tap on any other words in the text that you would like to highlight.',
'Click/Tap on any highlighted words to remove the highlighting.',
'Select the <b>Create a word list</b> or <b>Create an exercise</b> button.',
'If you selected <b>Create an exercise</b>, choose your display options.',
'You can now export your word list or exercise.',
],
filterinst: 'Choose which words to highlight',
legalText: '(If you copy existing material, for example from the internet, when using this tool, you may need the consent of the copyright owner)',
};
exports.activityFilterCheckBoxes = [
{ text: 'Select All', type: 'all', name: 'Select All', checked: false },
{ text: 'A1', type: 'ox3k', name: 'a1', checked: false },
{ text: 'A2', type: 'ox3k', name: 'a2', checked: false },
{ text: 'B1', type: 'ox3k', name: 'b1', checked: false },
{ text: 'B2 (Oxford 3000)', type: 'ox3k', name: 'b2', checked: false },
{ text: 'B2 (Oxford 5000 excluding Oxford 3000)', type: 'ox5k_only', name: 'b2', checked: false },
// { text: "B2 (Oxford 5000 excluding Oxford 3000)", type: "ox5k", name: 'b2', checked: false },
{ text: 'C1', type: 'ox5k', name: 'c1', checked: false },
{ text: 'OPAL written words', type: 'opal', name: 'opal', checked: false },
{ text: 'Unclassified', type: undefined, name: undefined, checked: false },
];
exports.wordListCategories = {
a1_ox3k: { text: 'A1 Oxford 3000', type: 'ox3k', name: 'a1', words: [], color: '#0069b4' },
a2_ox3k: { text: 'A2 Oxford 3000', type: 'ox3k', name: 'a2', words: [], color: '#c91352' },
b1_ox3k: { text: 'B1 Oxford 3000', type: 'ox3k', name: 'b1', words: [], color: '#b95b0b' },
b2_ox3k: { text: 'B2 Oxford 3000', type: 'ox3k', name: 'b2', words: [], color: '#1a873b' },
// 'b2_ox5k_only': { text: "B2 Oxford 5000 excluding Oxford 3000", type: "ox5k_only", name: 'b2', words: [], color: "#1a873b" },
b2_ox5k: { text: 'B2 Oxford 5000 excluding Oxford 3000', type: 'ox5k_only', name: 'b2', words: [], color: '#1a873b' },
c1_ox5k: { text: 'C1 Oxford 5000', type: 'ox5k', name: 'c1', words: [], color: '#964db0' },
opal: { text: 'OPAL written words', type: 'opal', name: 'opal', words: [], color: '#1e73b7' },
uncl: { text: 'Unclassified', type: undefined, name: undefined, words: [], color: '#585d65' },
};
exports.createExercisechkboxes = [
{ text: 'Show missing words in a box', name: 'showmissing', checked: false },
{ text: 'Show first letter of missing words', name: 'showFirst', checked: false },
];
//# sourceMappingURL=text.js.map