blob: c20e4549e6064404ed4a6eda3d2a2c7626f5a321 [file] [log] [blame]
Akron5cf5fca2017-10-09 19:01:47 +02001package Krawfish::Compile::Segment::Sort::Substring;
Akronfac366e2017-02-23 15:54:26 +01002use Krawfish::Log;
3use strict;
4use warnings;
5
Akron0f8fb082017-10-09 15:54:41 +02006warn 'NOT USED YET';
7
Akronfac366e2017-02-23 15:54:26 +01008# To support C2-Wort-Type sorting based on word endings,
9# It's necessary to support sorting based on substrings.
10#
11# EXAMPLE:
12# Sort based on the last two characters of a word in the
13# correct order: substring(-2,2)
14#
15# match1: D[er] al[te] Ma[nn]
16# match2: D[er] gu[te] Schäf[er]
17#
Akron184b2cf2017-08-20 20:51:21 +020018# This requires that all terms of a class are fetched from
19# the dictionary (or at least X characters).
Akronfac366e2017-02-23 15:54:26 +010020# Equal sequences will receive the same rank and can then be
21# sorted alphabetically in the next run.
22# Equal may mean that this is case insensitive.
23
24sub new {
25 my $class = shift;
26 bless {
27 offset => shift, # Supports negative offset
28 length => shift,
29 reverse => shift, # The substring is read from right to left
30 caseinsensitive => shift,
31 resolve_diacritiques => shift
32 }, $class;
33};
34
35
361;