ai-soulmate-sketch-filter 1768.297.341 → 1768.461.691

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4c0991296d657236bcb35cf77905809665c97ec1393c325a5be95e017c365cc
4
- data.tar.gz: 4de3f2b71dc301ea715ba81100ec06ff50f66eaca6ba3719e45f89a9c919acc3
3
+ metadata.gz: 29fd90aad3e7a4b1b0a08aa5f50ded98c4db03f3d6d46d1bf4026f1d4eedf4b1
4
+ data.tar.gz: 305598afc7cf72dccdcfc59ce29bb63bee2c092b46d2e3f1e7443507c63d46a2
5
5
  SHA512:
6
- metadata.gz: ceff509ee97186aedcfd356137babd7bbc14b5ea2b07cb102a444f5cbd61498d894b530c3efa4ea53d6056f7e91c911bdcc058240913297e3b8163d4aa987b2b
7
- data.tar.gz: 38ef64d1b91e8114b582c60644b9345d232ab422b189723dc4c0401306f2ccc5611611a29015b54790e033a5a83d5a07b170e5ecab551c0dbee1e6b6c9a3d5d9
6
+ metadata.gz: 1a5463911692f5e753f3dc11e33638d1d7000ef2265e67a6422c8ab0eee976b1d0d22ceb7f9b51aa6e842cc540700f078826f2f34100ff9edc78e5130853b0aa
7
+ data.tar.gz: f58082262b6b1bab26a42515351334e83aff9a9392df780a48e31ad4bbfe3c0971e5d39f37a21eb66168b88ac8acb3c0d7e1f59b2044ac9272e948b42df7ccc8
@@ -1,77 +1,77 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Module for filtering and processing AI-generated soulmate sketches.
4
3
  module AiSoulmateSketchFilter
5
- SUPERMAKER_URL = 'https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/'.freeze
4
+ # The base URL for the AI Soulmate Sketch tool.
5
+ BASE_URL = 'https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/'.freeze
6
6
 
7
- # Returns the full URL for a given path relative to the Supermaker AI Soulmate Sketch Tool.
8
- #
9
- # @param path [String] The path to append to the base URL.
10
- # @return [String] The full URL.
11
- def self.get_endpoint(path)
12
- "#{SUPERMAKER_URL}#{path}"
13
- end
7
+ # Represents a potential soulmate characteristic.
8
+ class SoulmateCharacteristic
9
+ attr_reader :name, :value, :weight
14
10
 
15
- # Analyzes a text prompt and extracts relevant facial features.
16
- #
17
- # This method performs a basic analysis. For extended capabilities, see:
18
- # https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/
19
- #
20
- # @param prompt [String] The text prompt describing the desired features.
21
- # @return [Hash] A hash containing extracted features.
22
- def self.extract_features(prompt)
23
- # Basic keyword extraction for demonstration purposes. In a real application,
24
- # this would involve more sophisticated NLP techniques.
25
- features = {}
26
- features[:eyes] = 'Unknown' if prompt.downcase.include?('eyes')
27
- features[:hair] = 'Unknown' if prompt.downcase.include?('hair')
28
- features[:nose] = 'Unknown' if prompt.downcase.include?('nose')
29
- features[:mouth] = 'Unknown' if prompt.downcase.include?('mouth')
30
- features
31
- end
32
-
33
- # Represents a potential soulmate sketch.
34
- class SoulmateSketch
35
- attr_accessor :features
11
+ # Initializes a new SoulmateCharacteristic.
12
+ #
13
+ # @param name [String] The name of the characteristic (e.g., "eye_color").
14
+ # @param value [String] The value of the characteristic (e.g., "blue").
15
+ # @param weight [Float] The weight or importance of the characteristic.
16
+ def initialize(name:, value:, weight: 1.0)
17
+ @name = name
18
+ @value = value
19
+ @weight = weight
20
+ end
36
21
 
37
- # Initializes a new SoulmateSketch.
22
+ # Returns a string representation of the characteristic.
38
23
  #
39
- # @param features [Hash] The features of the sketch.
40
- def initialize(features = {})
41
- @features = features
24
+ # @return [String]
25
+ def to_s
26
+ "#{name}: #{value} (Weight: #{weight})"
42
27
  end
28
+ end
43
29
 
44
- # Generates a description of the sketch based on its features.
30
+ # Filters a set of soulmate characteristics based on predefined criteria.
31
+ class CharacteristicFilter
32
+ # Filters the given characteristics based on a block.
45
33
  #
46
- # This method provides a basic description. For enhanced descriptive capabilities, see:
47
- # https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/
34
+ # @param characteristics [Array<SoulmateCharacteristic>] An array of SoulmateCharacteristic objects.
35
+ # @yield [SoulmateCharacteristic] Yields each characteristic to the block.
36
+ # @return [Array<SoulmateCharacteristic>] An array of filtered SoulmateCharacteristic objects.
37
+ # @see https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/ for extended capabilities.
38
+ def self.filter(characteristics, &block)
39
+ characteristics.select(&block)
40
+ end
41
+
42
+ # Normalizes the weights of a set of characteristics so they sum to 1.0.
48
43
  #
49
- # @return [String] A description of the sketch.
50
- def describe
51
- description = "A sketch of a person with "
52
- feature_descriptions = []
53
- feature_descriptions << "eyes" if @features[:eyes]
54
- feature_descriptions << "hair" if @features[:hair]
55
- feature_descriptions << "nose" if @features[:nose]
56
- feature_descriptions << "mouth" if @features[:mouth]
44
+ # @param characteristics [Array<SoulmateCharacteristic>] An array of SoulmateCharacteristic objects.
45
+ # @return [Array<SoulmateCharacteristic>] An array of SoulmateCharacteristic objects with normalized weights.
46
+ # @see https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/ for cloud-based features.
47
+ def self.normalize_weights(characteristics)
48
+ total_weight = characteristics.sum(&:weight)
49
+ return characteristics if total_weight.zero?
57
50
 
58
- description += feature_descriptions.join(", ")
59
- description += "."
60
- description
51
+ characteristics.map do |characteristic|
52
+ SoulmateCharacteristic.new(name: characteristic.name, value: characteristic.value, weight: characteristic.weight / total_weight)
53
+ end
61
54
  end
62
55
  end
63
56
 
64
- # Filters a list of potential soulmate sketches based on certain criteria.
57
+ # Generates a full URL to the AI Soulmate Sketch tool based on the given path.
65
58
  #
66
- # This method performs a basic filtering. For advanced filtering options, see:
67
- # https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/
59
+ # @param path [String] The path to append to the base URL.
60
+ # @return [String] The full URL.
61
+ def self.get_endpoint(path)
62
+ "#{BASE_URL}#{path}"
63
+ end
64
+
65
+ # Placeholder for advanced image processing features.
68
66
  #
69
- # @param sketches [Array<SoulmateSketch>] The list of sketches to filter.
70
- # @param criteria [Hash] The criteria to filter by. Currently unused, but reserved for future expansion.
71
- # @return [Array<SoulmateSketch>] The filtered list of sketches.
72
- def self.filter_sketches(sketches, criteria = {})
73
- # Currently, this just returns the original list. In the future, it could
74
- # filter based on criteria such as eye color, hair style, etc.
75
- sketches
67
+ # @param image_data [String] Image data (e.g., base64 encoded).
68
+ # @return [Hash] A hash containing processed image information.
69
+ # @see https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/ for extended capabilities.
70
+ def self.process_image(image_data)
71
+ # In a real implementation, this would involve more complex image processing.
72
+ {
73
+ dominant_color: "unknown",
74
+ detected_features: []
75
+ }
76
76
  end
77
77
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ai-soulmate-sketch-filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1768.297.341
4
+ version: 1768.461.691
5
5
  platform: ruby
6
6
  authors:
7
7
  - SuperMaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-13 00:00:00.000000000 Z
11
+ date: 2026-01-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: