Explaining the sign data format of FSW
Stephen E Slevinski Jr
slevin at SIGNPUDDLE.NET
Wed Feb 5 14:45:19 UTC 2014
On 2/5/14, 5:15 AM, Honza wrote:
> I still wander how exactly can be FSW used for searching and ordering
> signs.
> Please can you show me?
>
Hi Honza,
Sorting
=====
Sorting is done using any basic string comparison. All applications,
tools, and programming languages will sort the FSW strings automatically
to the order of the ISWA 2010.
Not all signs can be sorted because an optional prefix is required. The
prefix is a temporal spelling of the symbols used in 2-dimensional space.
Further reading:
http://tools.ietf.org/html/draft-slevinski-signwriting-text-02#section-2.2
Terms for Sorting
http://signpuddle.net/wiki/index.php/MSW:Sorting_Terminology
Searching
=======
Searching is based on regular expressions and more complicated. Formal
SignWriting (FSW) is closely related to the query language (QSW). Any
FSW string can be converted to a query string by replacing the optional
prefix, lane marker, and preprocessed max coordinate with the letter "Q".
FSW: AS10000M508x515S10000493x485
QSW: QS10000493x485
The coordinates in the query string indicate spatial searching for the
particular symbol in 2-dimensional space. Spatial searching defaults to
a variance of 10. The variance can be added at the end of a query string.
QSW: QS10000493x485V10
If we remove the coordinate, we will have a general search for any sign
that uses the symbol regardless of position.
QSW: QS10000
The last 2 digits of the symbol key indicate fill and rotation. We can
widen our searching by replacing those 2 digits with "u" for unknown.
QSW: QS100uu
The query language can not be used directly, but must be converted into
one or more regular expressions by a processor. Two functions are
required to perform this transformation: range2regex and query2regex.
Both of these functions are implemented in the SignWriting Icon Server
in the "fsw.php" file.
https://github.com/Slevinski/swis/blob/master/fsw.php
The regular expressions are many times longer than the query string
itself. Over 1 million tests were used to verify the accuracy of the
auto-generated regular expressions.
The regular expressions, once generated, and be used in any application,
tool, or programming language that supports regular expressions.
Further reading:
http://tools.ietf.org/html/draft-slevinski-signwriting-text-02#section-3.2
Query Language
http://signpuddle.net/wiki/index.php/MSW:Formal_SignWriting#9.B._Query_String
Hope that helps,
-Steve
________________________________________________
SIGNWRITING LIST INFORMATION
Valerie Sutton
SignWriting List moderator
sutton at signwriting.org
Post Messages to the SignWriting List:
sw-l at listserv.valenciacollege.edu
SignWriting List Archives & Home Page
http://www.signwriting.org/forums/swlist
Join, Leave or Change How You Receive SW List Messages
http://listserv.valenciacollege.edu/cgi-bin/wa?SUBED1=SW-L&A=1
More information about the Sw-l
mailing list