zompist bboard

THIS IS AN ARCHIVE ONLY - see Ephemera
It is currently Thu Nov 21, 2019 6:42 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Sun Oct 16, 2011 4:23 pm 
Avisaru
Avisaru

Joined: Wed Dec 15, 2004 9:05 am
Posts: 275
Location: Nottingham, England
I was wondering if it would be possible to add better support for formatting interlinear glosses to a phpbb board like the ZBB. A while ago I developed a small plugin for the dokuwiki software, that forced the morphemes in interlinear glosses to align by using tables. I've also build something similar into the new version of my blog. There's a page on that here, complete with PHP source code and an example of what it does:

http://www.chrisdb.me.uk/wiki/doku.php? ... oss_plugin

After you've packed everything into tables all you need is to apply some CSS to force the browser to display them inline and remove any borders. When I first looked at this a long time ago, I also looked at using the ruby tags, but a lot of browsers don't support them properly so inlined tables is a better approach.

It seems like this is something that would be pretty useful for something like the ZBB, given that we mostly talk about linguistics. It's a real pain when people do interlinears and the lengths of the morphemes don't line up, so it's hard to figure out which bit is which.

I've googled to find out what support phpBB has for custom tags, and it looks like it basically just done very simple find and replace using regexes. This wouldn't be enough to do the interlinears using tables. Since that's the case, it looks like you're probably have to just tag the interlinears using a span tag or similar, and then use some custom javascript to build the tables on the client-side.

Doing this shouldn't be too difficult. It would involve:

1. setting up custom tags [interlinear] which translate into <span class="interlinear">
2. writing a simple javascript function that scans through a page looking for <span class="interlinear"> and replaces it with the inlined tables, using approximately the algorithm outlined above. Each table needs to have class "interlinear"
3. adding a bit of css to inline tables with class "interlinear" and remove borders / other unwanted formatting

Is anyone else interested in this? Zompist, are you interested?

_________________
Try the online version of the HaSC sound change applier: http://chrisdb.dyndns-at-home.com/HaSC


Top
 Profile  
 
PostPosted: Sun Oct 16, 2011 5:18 pm 
Smeric
Smeric
User avatar

Joined: Thu Aug 30, 2007 10:45 pm
Posts: 2373
Location: Santiago de Chile
excellent it would be
Implemented, however, I think not
nevertheless with it best of luck

_________________
Articles on Suenu - Amphitrite


Top
 Profile  
 
PostPosted: Mon Oct 17, 2011 6:54 am 
Boardlord
Boardlord

Joined: Thu Sep 12, 2002 8:26 pm
Posts: 3377
Location: In the den
If you want to try to do the work, go for it. :)

So long as spinn is hosting, I can change templates and stylesheets; I can't change any PHP files.

The thing is, the changes have to be isolated enough that they can be reapplied with phpbb updates. That is, if you change the code in a hundred places, it's not going to be easy to reapply.


Top
 Profile  
 
PostPosted: Tue Oct 18, 2011 1:35 pm 
Avisaru
Avisaru

Joined: Wed Dec 15, 2004 9:05 am
Posts: 275
Location: Nottingham, England
I guess I'll probably try to code it up in Javascript in the next week or two. When I have something that works I'll post again and ask for volunteers to test it.

_________________
Try the online version of the HaSC sound change applier: http://chrisdb.dyndns-at-home.com/HaSC


Top
 Profile  
 
PostPosted: Tue Oct 18, 2011 3:27 pm 
Lebom
Lebom
User avatar

Joined: Sat Feb 03, 2007 12:55 pm
Posts: 132
Location: 常世
Actually, PhpBB3 possesses the ability to add and create new BBCode through the admin panel, which essentially consists in creating rules to replace [tags][/tags] with appropriately formatted HTML. Though you wouldn't be able to use the php code linked, you could easily find an alternative solution mixing html and css.

http://www.phpbb.com/kb/article/adding- ... in-phpbb3/

_________________
Chances are it's Ryukyuan (Resources).


Top
 Profile  
 
PostPosted: Tue Oct 18, 2011 9:02 pm 
Avisaru
Avisaru
User avatar

Joined: Thu Jul 24, 2003 2:40 pm
Posts: 491
Location: Maryland
Instead of tables, might I recommend something like what I did on this page in the Novegradian grammar? The overall appearance is the same, but it has a number of advantages:

1) It wraps correctly. Long tables will need manual breaks or will stretch the page, whereas the method I used using definition tags + some CSS wraps all by itself

2) The code is a bit nicer, since it keeps the words and the glosses for each word together in the code. In a table, you would have a single row of the native language followed by a row of glosses, which for long sentences could mean the original language and gloss are confusingly far about in the HTML.

3) If you care at all, it's a bit more semantic than tables are, since definition lists come a bit closer to glosses than plain old tables do.

In the HTML, it just works as a long series of definition items, like this:
Code:
<div class="glossblock">
   <dl>
       <dt>Вецераш,</dt>
        <dd>Véceraś,<br>yesterday</dd>
    </dl>
    <dl>
       <dt>дуадеши</dt>
        <dd>duadéśi<br>twenty</dd>
    </dl>
    <dl>
       <dt>цедиртий</dt>
        <dd>cedírtij<br>fourth</dd>
    </dl>
    ...
</div>


And the CSS is just:
Code:
.glossblock
{
   clear: both;
   font-size: 12px;
   padding-top: 5px
   padding-bottom: 5px;
}

.glossblock dl
{
   float: left;
    margin: 0 0.5em 0.5em 0;
    text-align: left;
}

.glossblock dt
{
   font-style: italic;
}

.glossblock dd
{
   margin-left: 0cm;
}

_________________
http://www.veche.net/
http://www.veche.net/novegradian - Grammar of Novegradian
http://www.veche.net/alashian - Grammar of Alashian


Top
 Profile  
 
PostPosted: Wed Oct 19, 2011 2:49 am 
Avisaru
Avisaru

Joined: Wed Dec 15, 2004 9:05 am
Posts: 275
Location: Nottingham, England
Mecislau wrote:
Instead of tables, might I recommend something like what I did on this page in the Novegradian grammar? The overall appearance is the same, but it has a number of advantages:

1) It wraps correctly. Long tables will need manual breaks or will stretch the page, whereas the method I used using definition tags + some CSS wraps all by itself


In fact, what I did before was a table for each word to make the morphemes within the word align properly. The words automatically align properly because they're in different tables. In your example, it doesn't look like the within-word morphemes line up? Although I guess it could be tweaked to do that, although what it can't do is prevent wrapping in the middle of a word if you use a separate definition for each morpheme.

Quote:
2) The code is a bit nicer, since it keeps the words and the glosses for each word together in the code. In a table, you would have a single row of the native language followed by a row of glosses, which for long sentences could mean the original language and gloss are confusingly far about in the HTML.


That's true.

Quote:
3) If you care at all, it's a bit more semantic than tables are, since definition lists come a bit closer to glosses than plain old tables do.

In the HTML, it just works as a long series of definition items, like this:
Code:
<div class="glossblock">
   <dl>
       <dt>Вецераш,</dt>
        <dd>Véceraś,<br>yesterday</dd>
    </dl>
    <dl>
       <dt>дуадеши</dt>
        <dd>duadéśi<br>twenty</dd>
    </dl>
    <dl>
       <dt>цедиртий</dt>
        <dd>cedírtij<br>fourth</dd>
    </dl>
    ...
</div>


And the CSS is just:
Code:
.glossblock
{
   clear: both;
   font-size: 12px;
   padding-top: 5px
   padding-bottom: 5px;
}

.glossblock dl
{
   float: left;
    margin: 0 0.5em 0.5em 0;
    text-align: left;
}

.glossblock dt
{
   font-style: italic;
}

.glossblock dd
{
   margin-left: 0cm;
}

_________________
Try the online version of the HaSC sound change applier: http://chrisdb.dyndns-at-home.com/HaSC


Last edited by chris_notts on Wed Oct 19, 2011 2:58 am, edited 2 times in total.

Top
 Profile  
 
PostPosted: Wed Oct 19, 2011 2:52 am 
Avisaru
Avisaru

Joined: Wed Dec 15, 2004 9:05 am
Posts: 275
Location: Nottingham, England
Hakaku wrote:
Actually, PhpBB3 possesses the ability to add and create new BBCode through the admin panel, which essentially consists in creating rules to replace [tags][/tags] with appropriately formatted HTML. Though you wouldn't be able to use the php code linked, you could easily find an alternative solution mixing html and css.

http://www.phpbb.com/kb/article/adding- ... in-phpbb3/


I already mentioned that. But I don't believe that the find and replace functionality it offers is powerful enough for what we want to do. I don't want to force users to manually build the tag structure. What should happen is this:

Code:
[interlinear]
hola, como esta-s?
hello, how are-you?
[/interlinear]


And then each line is broken up based on white space and morpheme markers (like -) and turned into the appropriate HTML. As far as I can see, the only way to do it all using the built in functionality is to force the user to use tags to manually specify a lot more of the structure, which is such a pain that no-one will use it.

_________________
Try the online version of the HaSC sound change applier: http://chrisdb.dyndns-at-home.com/HaSC


Top
 Profile  
 
PostPosted: Wed Oct 19, 2011 10:16 am 
Lebom
Lebom

Joined: Fri Mar 27, 2009 5:50 pm
Posts: 169
Mecislau wrote:
Instead of tables, might I recommend something like what I did on this page in the Novegradian grammar?

Ooooh now see, I tried to do this on the Feayran site but couldn't figure out a good way to make it work--didn't think to use definition lists. Brilliant!

(Code question: why do you use br tags? Does adding additional dd tags break it?)

Aligning morphemes within the word would be nice, but as Chris says, I'm pretty sure that'd require a good deal of markup to be added to the text. Too much work to do manually, but so long as zompist can add javascript to the page templates, that could work.

Alternatively, Mecislau's system could be implemented pretty easily with some custom bbCode.


Top
 Profile  
 
PostPosted: Wed Oct 19, 2011 11:29 am 
Avisaru
Avisaru

Joined: Wed Dec 15, 2004 9:05 am
Posts: 275
Location: Nottingham, England
Trailsend wrote:
Mecislau wrote:
Instead of tables, might I recommend something like what I did on this page in the Novegradian grammar?

Ooooh now see, I tried to do this on the Feayran site but couldn't figure out a good way to make it work--didn't think to use definition lists. Brilliant!

(Code question: why do you use br tags? Does adding additional dd tags break it?)

Aligning morphemes within the word would be nice, but as Chris says, I'm pretty sure that'd require a good deal of markup to be added to the text. Too much work to do manually, but so long as zompist can add javascript to the page templates, that could work.


I think it can be done easily by the Javascript solution I proposed, whether that's using tables or definition lists. We apply a simple rule on the board that translations [interlinear] to <span class="interlinear"> then include a small Javascript function that scans through and builds the tables / definition lists afterwards on the client side.

Doing it this way also isn't harmful, because if the user for some reason doesn't have javascript enabled, they just get the non-aligned version with a harmless span tag that doesn't really make any difference to formatting.

I think it has to be done this way whether you use tables or definition losts, because otherwise the user has to manually apply a lot of tags to each word/morpheme that will make it too painful to use. Really, the goal has to be that the extent of user intervention required is wrapping their interlinears with [interlinear] and [/interlinear].

That's basically how my home grown blog works, although that's coded up in Haskell on the server side rather than Javascript. See more examples using tables here:

http://chrisdb.dyndns-at-home.com/blog/ ... -agreement

_________________
Try the online version of the HaSC sound change applier: http://chrisdb.dyndns-at-home.com/HaSC


Top
 Profile  
 
PostPosted: Fri Oct 21, 2011 2:10 pm 
Sanno
Sanno

Joined: Tue Nov 14, 2006 10:30 am
Posts: 939
Location: Tübingen, Germany
Trailsend wrote:
Mecislau wrote:
Instead of tables, might I recommend something like what I did on this page in the Novegradian grammar?

Ooooh now see, I tried to do this on the Feayran site but couldn't figure out a good way to make it work--didn't think to use definition lists. Brilliant!

(Code question: why do you use br tags? Does adding additional dd tags break it?)

No, it doesn't. HTML syntax supports several definitions for one item, and the CSS for this type of interlinears does so as well. (I've implemented the same thing as a MediaWiki template for use on both AkanaWiki and FrathWiki, using additional dd tags for additional gloss lines.)

_________________
Blog: audmanh.wordpress.com
Conlangs: Ronc Tyu | Buruya Nzaysa | Doayâu | Tmaśareʔ


Top
 Profile  
 
PostPosted: Fri Oct 21, 2011 6:03 pm 
Avisaru
Avisaru
User avatar

Joined: Thu Jul 24, 2003 2:40 pm
Posts: 491
Location: Maryland
cedh audmanh wrote:
Trailsend wrote:
Mecislau wrote:
Instead of tables, might I recommend something like what I did on this page in the Novegradian grammar?

Ooooh now see, I tried to do this on the Feayran site but couldn't figure out a good way to make it work--didn't think to use definition lists. Brilliant!

(Code question: why do you use br tags? Does adding additional dd tags break it?)

No, it doesn't. HTML syntax supports several definitions for one item, and the CSS for this type of interlinears does so as well. (I've implemented the same thing as a MediaWiki template for use on both AkanaWiki and FrathWiki, using additional dd tags for additional gloss lines.)


Oh, hah, whoops. That was just a silly oversight on my part.


And yeah, writing a simple parser in Javascript would not be a problem at all.

_________________
http://www.veche.net/
http://www.veche.net/novegradian - Grammar of Novegradian
http://www.veche.net/alashian - Grammar of Alashian


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group