Class: Indofix::IndofixKpstHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/indofix/indofix_kpst_helper.rb

Instance Method Summary collapse

Instance Method Details

#imbuhan_m_x(string) ⇒ Object

pelepasan imbuhan ‘me’ dengan ‘m’



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/indofix/indofix_kpst_helper.rb', line 59

def imbuhan_m_x(string)
  @verex = VerEx.new do
    start_of_line
    find 'm'
    begin_capture
    anything
    end_capture
    end_of_line
  end
  return @verex.match(string)
end

#imbuhan_n_x(string) ⇒ Object

pelepasan imbuhan ‘me’ dengan ‘n’



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/indofix/indofix_kpst_helper.rb', line 7

def imbuhan_n_x(string)
  @verex = VerEx.new do
    start_of_line
    find 'n'
    begin_capture
    anything
    end_capture
    end_of_line
  end
  return @verex.match(string)
end

#imbuhan_ng_x(string) ⇒ Object

pelepasan imbuhan ‘me’ dengan ‘ng’



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/indofix/indofix_kpst_helper.rb', line 20

def imbuhan_ng_x(string)
  @verex = VerEx.new do
    start_of_line
    find 'ng'
    begin_capture
    anything
    end_capture
    end_of_line
  end
  return @verex.match(string)
end

#imbuhan_nge_x(string) ⇒ Object

pelepasan imbuhan ‘me’ dengan ‘nge’



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/indofix/indofix_kpst_helper.rb', line 33

def imbuhan_nge_x(string)
  @verex = VerEx.new do
    start_of_line
    find 'nge'
    begin_capture
    anything
    end_capture
    end_of_line
  end
  return @verex.match(string)
end

#imbuhan_ny_x(string) ⇒ Object

pelepasan imbuhan ‘me’ dengan ‘ny’



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/indofix/indofix_kpst_helper.rb', line 46

def imbuhan_ny_x(string)
  @verex = VerEx.new do
    start_of_line
    find 'ny'
    begin_capture
    anything
    end_capture
    end_of_line
  end
  return @verex.match(string)
end

#process_imbuhan_n_ng(match) ⇒ Object

auto processing pemroresan pelepasan n -> ng(nge)/ny, m



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/indofix/indofix_kpst_helper.rb', line 73

def process_imbuhan_n_ng(match)
  @match = match
  if !@match.nil?
    @string = @match[1]
    if !imbuhan_n_x(@string).nil?
      if !imbuhan_ng_x(@string).nil?
        if !imbuhan_nge_x(@string).nil?
          return imbuhan_nge_x(@string)
        else
          return imbuhan_ng_x(@string)
        end
      elsif !imbuhan_ny_x(@string).nil?
        return imbuhan_ny_x(@string)
      else
        return imbuhan_n_x(@string)
      end
    elsif !imbuhan_m_x(@string).nil?
      return imbuhan_m_x(@string)
    else
      return @match
    end
  else
    return @match
  end
end

#process_ktsp(match) ⇒ Object

TODO: next



100
101
102
103
104
105
106
107
# File 'lib/indofix/indofix_kpst_helper.rb', line 100

def process_ktsp(match)
  @match = match
  if !@match.nil?
    @string = @match[1]
  else
    return @match
  end
end